Add first helper method to user
This commit is contained in:
parent
f3a139b809
commit
11e0059631
6 changed files with 16 additions and 7 deletions
|
@ -24,7 +24,7 @@ func (a *Authenticator) PerformPasswordLogin(
|
|||
if ok, err := a.canUsernameLogin(username); !ok {
|
||||
return LoginNextFailure, "", 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)
|
||||
switch err {
|
||||
case nil:
|
||||
break
|
||||
|
@ -110,7 +110,7 @@ func (a *Authenticator) PerformPasswordLogin(
|
|||
// If there is no password set yet (i.e. during account registration or passkey only so far)
|
||||
// it creates the password link
|
||||
func (a *Authenticator) PerformPasswordRegister(username, password string) error {
|
||||
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 to add a password to", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue