mirror of
https://github.com/go-gitea/gitea.git
synced 2025-12-08 17:55:50 +01:00
Fix oauth2 sync error
We'd better to use id to find a user. Not LoginName. And LoginName!= ExternalID
This commit is contained in:
parent
23a37b4b77
commit
0b1b1430be
@ -47,7 +47,7 @@ func (source *Source) Sync(ctx context.Context, updateExisting bool) error {
|
||||
}
|
||||
|
||||
func (source *Source) refresh(ctx context.Context, provider goth.Provider, u *user_model.ExternalLoginUser) error {
|
||||
log.Trace("Syncing login_source_id=%d external_id=%s expiration=%s", u.LoginSourceID, u.ExternalID, u.ExpiresAt)
|
||||
log.Trace("Syncing login_source_id=%d external_id=%s user_id=%s expiration=%s", u.LoginSourceID, u.ExternalID, u.UserID, u.ExpiresAt)
|
||||
|
||||
shouldDisable := false
|
||||
|
||||
@ -62,7 +62,7 @@ func (source *Source) refresh(ctx context.Context, provider goth.Provider, u *us
|
||||
}
|
||||
|
||||
user := &user_model.User{
|
||||
LoginName: u.ExternalID,
|
||||
ID: u.UserID,
|
||||
LoginType: auth.OAuth2,
|
||||
LoginSource: u.LoginSourceID,
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user