Add first helper method to user
This commit is contained in:
parent
f3a139b809
commit
11e0059631
6 changed files with 16 additions and 7 deletions
|
@ -31,7 +31,7 @@ func (a *Authenticator) StartPasskeyLogin(
|
|||
if ok, err := a.canUsernameLogin(username); !ok {
|
||||
return nil, "", other.Error("auth", "user may not login", err)
|
||||
}
|
||||
acc, err := dbgen.User.Where(dbgen.User.Username.Eq(username)).First()
|
||||
acc, err := dbgen.User.GetByUsername(username)
|
||||
if err != nil {
|
||||
return nil, "", other.Error("auth", "failed to acquire user for login", err)
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ func (a *Authenticator) CompletePasskeyLogin(
|
|||
response *http.Request,
|
||||
) (accessToken string, err error) {
|
||||
// Get user in question
|
||||
acc, err := dbgen.User.Where(dbgen.User.Username.Eq(username)).First()
|
||||
acc, err := dbgen.User.GetByUsername(username)
|
||||
if err != nil {
|
||||
return "", other.Error("auth", "failed to get user for passkey login completion", err)
|
||||
}
|
||||
|
@ -140,7 +140,7 @@ func (a *Authenticator) StartPasskeyRegistration(
|
|||
if ok, err := a.canUsernameLogin(username); !ok {
|
||||
return nil, "", other.Error("auth", "user may not login", err)
|
||||
}
|
||||
acc, err := dbgen.User.Where(dbgen.User.Username.Eq(username)).First()
|
||||
acc, err := dbgen.User.GetByUsername(username)
|
||||
if err != nil {
|
||||
return nil, "", other.Error("auth", "failed to acquire user for login", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue