Support both email and phone login
Auto-detect whether the user entered an email or phone number. Email sends via Resend, phone sends via Twilio SMS. Users table has nullable phone and email columns; verification_codes uses a generic identifier field. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+7
-6
@@ -55,15 +55,16 @@ type Slot struct {
|
||||
|
||||
type User struct {
|
||||
ID int64
|
||||
Phone string
|
||||
Phone sql.NullString
|
||||
Email sql.NullString
|
||||
Name string
|
||||
CreatedAt time.Time
|
||||
}
|
||||
|
||||
type VerificationCode struct {
|
||||
ID int64
|
||||
Phone string
|
||||
Code string
|
||||
ExpiresAt time.Time
|
||||
Used int64
|
||||
ID int64
|
||||
Identifier string
|
||||
Code string
|
||||
ExpiresAt time.Time
|
||||
Used int64
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user