Skip to content

Commit

Permalink
fix bitbucket SSO using UUID from bitbucket api response as ForgeRemo…
Browse files Browse the repository at this point in the history
  • Loading branch information
healdropper authored and fernandrone committed Feb 1, 2024
1 parent d38e0cb commit 76fba35
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/forge/bitbucket/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
}
}

Expand Down
1 change: 1 addition & 0 deletions server/forge/bitbucket/fixtures/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ const pullRequestsPayload = `

const userPayload = `
{
"uuid": "{4d8c0f46-cd62-4b77-b0cf-faa3e4d932c6}",
"username": "superman",
"links": {
"avatar": {
Expand Down
2 changes: 1 addition & 1 deletion server/forge/bitbucket/internal/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down

0 comments on commit 76fba35

Please sign in to comment.