fix bitbucket SSO using UUID from bitbucket api response as ForgeRemoteID (#3265)

This commit is contained in:
Alconety 2024-01-23 16:35:30 +01:00 committed by GitHub
parent 1c3159ebb7
commit 8cb86ddc68
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 2 deletions

View file

@ -137,7 +137,7 @@ func convertUser(from *internal.Account, token *oauth2.Token) *model.User {
Secret: token.RefreshToken,
Expiry: token.Expiry.UTC().Unix(),
Avatar: from.Links.Avatar.Href,
ForgeRemoteID: model.ForgeRemoteID(fmt.Sprint(from.ID)),
ForgeRemoteID: model.ForgeRemoteID(fmt.Sprint(from.UUID)),
}
}

View file

@ -300,6 +300,7 @@ const pullRequestsPayload = `
const userPayload = `
{
"uuid": "{4d8c0f46-cd62-4b77-b0cf-faa3e4d932c6}",
"username": "superman",
"links": {
"avatar": {

View file

@ -21,7 +21,7 @@ import (
)
type Account struct {
ID int64 `json:"id"`
UUID string `json:"uuid"`
Login string `json:"username"`
Name string `json:"display_name"`
Type string `json:"type"`