chore(auth): finalize test of new structure
This commit is contained in:
12
db/auth.go
12
db/auth.go
@@ -38,19 +38,19 @@ func NewUser(id uuid.UUID, email string, emailVerified bool, emailVerifiedAt tim
|
||||
}
|
||||
}
|
||||
|
||||
type Auth interface {
|
||||
type DbAuth interface {
|
||||
GetUser(email string) (*User, error)
|
||||
}
|
||||
|
||||
type AuthSqlite struct {
|
||||
type DbAuthSqlite struct {
|
||||
db *sql.DB
|
||||
}
|
||||
|
||||
func NewAuthSqlite(db *sql.DB) *AuthSqlite {
|
||||
return &AuthSqlite{db: db}
|
||||
func NewDbAuthSqlite(db *sql.DB) *DbAuthSqlite {
|
||||
return &DbAuthSqlite{db: db}
|
||||
}
|
||||
|
||||
func (a AuthSqlite) GetUser(email string) (*User, error) {
|
||||
func (db DbAuthSqlite) GetUser(email string) (*User, error) {
|
||||
var (
|
||||
userId uuid.UUID
|
||||
emailVerified bool
|
||||
@@ -61,7 +61,7 @@ func (a AuthSqlite) GetUser(email string) (*User, error) {
|
||||
createdAt time.Time
|
||||
)
|
||||
|
||||
err := a.db.QueryRow(`
|
||||
err := db.db.QueryRow(`
|
||||
SELECT user_uuid, email_verified, email_verified_at, password, salt, created_at
|
||||
FROM user
|
||||
WHERE email = ?`, email).Scan(&userId, &emailVerified, &emailVerifiedAt, &password, &salt, &createdAt)
|
||||
|
||||
Reference in New Issue
Block a user