Procházet zdrojové kódy

Sign: Handle ErrTwoFactorNotEnrolled correctly (#10008)

tags/v1.10.5
zeripath před 4 roky
rodič
revize
d087f4fb73
Žádný účet není propojen s e-mailovou adresou tvůrce revize
2 změnil soubory, kde provedl 4 přidání a 4 odebrání
  1. 1
    1
      models/pull_sign.go
  2. 3
    3
      models/repo_sign.go

+ 1
- 1
models/pull_sign.go Zobrazit soubor

@@ -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 Zobrazit soubor

@@ -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 {

Načítá se…
Zrušit
Uložit