mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-01-10 09:05:30 +00:00
style: fix fmt and lint
This commit is contained in:
parent
8bd1c7ff31
commit
32de0745e4
1 changed files with 7 additions and 4 deletions
|
@ -17,6 +17,7 @@ import (
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
asymkey_model "code.gitea.io/gitea/models/asymkey"
|
||||||
"code.gitea.io/gitea/models/auth"
|
"code.gitea.io/gitea/models/auth"
|
||||||
org_model "code.gitea.io/gitea/models/organization"
|
org_model "code.gitea.io/gitea/models/organization"
|
||||||
user_model "code.gitea.io/gitea/models/user"
|
user_model "code.gitea.io/gitea/models/user"
|
||||||
|
@ -48,8 +49,6 @@ import (
|
||||||
"github.com/markbates/goth/providers/openidConnect"
|
"github.com/markbates/goth/providers/openidConnect"
|
||||||
"github.com/markbates/goth/providers/zoom"
|
"github.com/markbates/goth/providers/zoom"
|
||||||
go_oauth2 "golang.org/x/oauth2"
|
go_oauth2 "golang.org/x/oauth2"
|
||||||
|
|
||||||
asymkey_model "code.gitea.io/gitea/models/asymkey"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -1209,7 +1208,7 @@ func getSSHKeys(source *oauth2.Source, gothUser *goth.User) ([]string, error) {
|
||||||
return sshKeys, nil
|
return sshKeys, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func updateSshPubIfNeed(
|
func updateSSHPubIfNeed(
|
||||||
ctx *context.Context,
|
ctx *context.Context,
|
||||||
authSource *auth.Source,
|
authSource *auth.Source,
|
||||||
fetchedUser *goth.User,
|
fetchedUser *goth.User,
|
||||||
|
@ -1240,7 +1239,11 @@ func updateSshPubIfNeed(
|
||||||
|
|
||||||
func handleOAuth2SignIn(ctx *context.Context, source *auth.Source, u *user_model.User, gothUser goth.User) {
|
func handleOAuth2SignIn(ctx *context.Context, source *auth.Source, u *user_model.User, gothUser goth.User) {
|
||||||
updateAvatarIfNeed(ctx, gothUser.AvatarURL, u)
|
updateAvatarIfNeed(ctx, gothUser.AvatarURL, u)
|
||||||
updateSshPubIfNeed(ctx, source, &gothUser, u)
|
err := updateSSHPubIfNeed(ctx, source, &gothUser, u)
|
||||||
|
if err != nil {
|
||||||
|
ctx.ServerError("updateSSHPubIfNeed", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
needs2FA := false
|
needs2FA := false
|
||||||
if !source.Cfg.(*oauth2.Source).SkipLocalTwoFA {
|
if !source.Cfg.(*oauth2.Source).SkipLocalTwoFA {
|
||||||
|
|
Loading…
Reference in a new issue