Parcourir la source

Sign: Handle ErrTwoFactorNotEnrolled correctly (#10008)

tags/v1.10.5
zeripath il y a 4 ans
Parent
révision
d087f4fb73
Aucun compte lié à l'adresse e-mail de l'auteur
2 fichiers modifiés avec 4 ajouts et 4 suppressions
  1. 1
    1
      models/pull_sign.go
  2. 3
    3
      models/repo_sign.go

+ 1
- 1
models/pull_sign.go Voir le fichier

@@ -43,7 +43,7 @@ func (pr *PullRequest) SignMerge(u *User, tmpBasePath, baseCommit, headCommit st
}
case twofa:
twofaModel, err := GetTwoFactorByUID(u.ID)
if err != nil {
if err != nil && !IsErrTwoFactorNotEnrolled(err) {
return false, "", err
}
if twofaModel == nil {

+ 3
- 3
models/repo_sign.go Voir le fichier

@@ -119,7 +119,7 @@ func SignInitialCommit(repoPath string, u *User) (bool, string, error) {
}
case twofa:
twofaModel, err := GetTwoFactorByUID(u.ID)
if err != nil {
if err != nil && !IsErrTwoFactorNotEnrolled(err) {
return false, "", err
}
if twofaModel == nil {
@@ -154,7 +154,7 @@ func (repo *Repository) SignWikiCommit(u *User) (bool, string, error) {
}
case twofa:
twofaModel, err := GetTwoFactorByUID(u.ID)
if err != nil {
if err != nil && !IsErrTwoFactorNotEnrolled(err) {
return false, "", err
}
if twofaModel == nil {
@@ -206,7 +206,7 @@ func (repo *Repository) SignCRUDAction(u *User, tmpBasePath, parentCommit string
}
case twofa:
twofaModel, err := GetTwoFactorByUID(u.ID)
if err != nil {
if err != nil && !IsErrTwoFactorNotEnrolled(err) {
return false, "", err
}
if twofaModel == nil {

Chargement…
Annuler
Enregistrer