Identify users using their remote ID (#1732)

This commit is contained in:
qwerty287
2023-05-11 05:19:35 +02:00
committed by GitHub
parent 02cfbc8cbf
commit 6d2240b2e6
14 changed files with 101 additions and 47 deletions

View File

@@ -133,11 +133,12 @@ func (g *GitLab) Login(ctx context.Context, res http.ResponseWriter, req *http.R
}
user := &model.User{
Login: login.Username,
Email: login.Email,
Avatar: login.AvatarURL,
Token: token.AccessToken,
Secret: token.RefreshToken,
Login: login.Username,
Email: login.Email,
Avatar: login.AvatarURL,
ForgeRemoteID: model.ForgeRemoteID(fmt.Sprint(login.ID)),
Token: token.AccessToken,
Secret: token.RefreshToken,
}
if !strings.HasPrefix(user.Avatar, "http") {
user.Avatar = g.URL + "/" + login.AvatarURL