Add SMS consent logging for Twilio compliance
Log phone, IP, and user agent to sms_consents table before sending verification SMS. Add disclosure text to login form. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -54,6 +54,14 @@ type Slot struct {
|
||||
SortOrder int64
|
||||
}
|
||||
|
||||
type SmsConsent struct {
|
||||
ID int64
|
||||
Phone string
|
||||
IpAddress string
|
||||
UserAgent string
|
||||
CreatedAt time.Time
|
||||
}
|
||||
|
||||
type User struct {
|
||||
ID int64
|
||||
Phone sql.NullString
|
||||
|
||||
@@ -132,3 +132,6 @@ SELECT * FROM rsvps WHERE id = ?;
|
||||
|
||||
-- name: UpdateRsvp :exec
|
||||
UPDATE rsvps SET name = ?, note = ?, plus_one = ? WHERE id = ?;
|
||||
|
||||
-- name: CreateSmsConsent :exec
|
||||
INSERT INTO sms_consents (phone, ip_address, user_agent) VALUES (?, ?, ?);
|
||||
|
||||
@@ -181,6 +181,21 @@ func (q *Queries) CreateSlot(ctx context.Context, arg CreateSlotParams) (Slot, e
|
||||
return i, err
|
||||
}
|
||||
|
||||
const createSmsConsent = `-- name: CreateSmsConsent :exec
|
||||
INSERT INTO sms_consents (phone, ip_address, user_agent) VALUES (?, ?, ?)
|
||||
`
|
||||
|
||||
type CreateSmsConsentParams struct {
|
||||
Phone string
|
||||
IpAddress string
|
||||
UserAgent string
|
||||
}
|
||||
|
||||
func (q *Queries) CreateSmsConsent(ctx context.Context, arg CreateSmsConsentParams) error {
|
||||
_, err := q.db.ExecContext(ctx, createSmsConsent, arg.Phone, arg.IpAddress, arg.UserAgent)
|
||||
return err
|
||||
}
|
||||
|
||||
const createUserByEmail = `-- name: CreateUserByEmail :one
|
||||
INSERT INTO users (email, name) VALUES (?, '') RETURNING id, phone, email, name, created_at
|
||||
`
|
||||
|
||||
Reference in New Issue
Block a user