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:
parent
934f026549
commit
4816785400
@ -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
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user