1
0

fix(caldav): make sure the caldav tokens of non-local accounts are properly checked

This commit is contained in:
kolaente
2022-07-04 18:08:41 +02:00
parent db1ccff0de
commit 4429ba2da1
3 changed files with 37 additions and 5 deletions

View File

@ -314,6 +314,10 @@ func CheckUserCredentials(s *xorm.Session, u *Login) (*User, error) {
return nil, ErrWrongUsernameOrPassword{}
}
if user.Issuer != IssuerLocal {
return user, &ErrAccountIsNotLocal{UserID: user.ID}
}
// The user is invalid if they need to verify their email address
if user.Status == StatusEmailConfirmationRequired {
return &User{}, ErrEmailNotConfirmed{UserID: user.ID}