0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-07-22 01:22:01 +02:00

fine tune

This commit is contained in:
wxiaoguang 2025-07-07 15:03:03 +08:00
parent 934f026549
commit 4816785400
3 changed files with 7 additions and 6 deletions

View File

@ -72,8 +72,6 @@ func SignInOAuth(ctx *context.Context) {
// SignInOAuthCallback handles the callback from the given provider
func SignInOAuthCallback(ctx *context.Context) {
provider := ctx.PathParam("provider")
if ctx.Req.FormValue("error") != "" {
var errorKeyValues []string
for k, vv := range ctx.Req.Form {
@ -86,7 +84,8 @@ func SignInOAuthCallback(ctx *context.Context) {
}
// first look if the provider is still active
authSource, err := auth.GetActiveOAuth2SourceByAuthName(ctx, provider)
authName := ctx.PathParam("provider")
authSource, err := auth.GetActiveOAuth2SourceByAuthName(ctx, authName)
if err != nil {
ctx.ServerError("SignIn", err)
return

View File

@ -39,7 +39,7 @@ func oauth2SignInSync(ctx *context.Context, authSource *auth.Source, u *user_mod
// only update if the full name is different
shouldUpdateFullName = shouldUpdateFullName && u.FullName != fullName
if shouldUpdateFullName {
u.FullName = gothUser.Name
u.FullName = fullName
if err := user_model.UpdateUserCols(ctx, u, "full_name"); err != nil {
log.Error("Unable to sync OAuth2 user full name %s: %v", gothUser.Provider, err)
}

View File

@ -12,8 +12,10 @@ import (
// BaseProvider represents a common base for Provider
type BaseProvider struct {
name string
displayName string
name string
displayName string
// TODO: maybe some providers also support SSH public keys, then they can set this to true
supportSSHPublicKey bool
}