1
0

fix(user): allow openid users to request their deletion

Resolves https://community.vikunja.io/t/delete-user-not-possible-when-using-oidc/1689/4
This commit is contained in:
kolaente
2023-10-11 19:06:59 +02:00
parent 58497f29e6
commit 9a29b29a04
2 changed files with 39 additions and 29 deletions

View File

@ -154,7 +154,7 @@ func (u *User) GetID() int64 {
}
// TableName returns the table name for users
func (User) TableName() string {
func (*User) TableName() string {
return "users"
}
@ -353,6 +353,10 @@ func CheckUserCredentials(s *xorm.Session, u *Login) (*User, error) {
return user, nil
}
func (u *User) IsLocalUser() bool {
return u.Issuer == IssuerLocal
}
func handleFailedPassword(user *User) {
key := user.GetFailedPasswordAttemptsKey()
err := keyvalue.IncrBy(key, 1)