mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-02-20 13:16:18 +00:00
fix bitbucket SSO using UUID from bitbucket api response as ForgeRemoteID (#3265)
This commit is contained in:
parent
1c3159ebb7
commit
8cb86ddc68
3 changed files with 3 additions and 2 deletions
|
@ -137,7 +137,7 @@ func convertUser(from *internal.Account, token *oauth2.Token) *model.User {
|
||||||
Secret: token.RefreshToken,
|
Secret: token.RefreshToken,
|
||||||
Expiry: token.Expiry.UTC().Unix(),
|
Expiry: token.Expiry.UTC().Unix(),
|
||||||
Avatar: from.Links.Avatar.Href,
|
Avatar: from.Links.Avatar.Href,
|
||||||
ForgeRemoteID: model.ForgeRemoteID(fmt.Sprint(from.ID)),
|
ForgeRemoteID: model.ForgeRemoteID(fmt.Sprint(from.UUID)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -300,6 +300,7 @@ const pullRequestsPayload = `
|
||||||
|
|
||||||
const userPayload = `
|
const userPayload = `
|
||||||
{
|
{
|
||||||
|
"uuid": "{4d8c0f46-cd62-4b77-b0cf-faa3e4d932c6}",
|
||||||
"username": "superman",
|
"username": "superman",
|
||||||
"links": {
|
"links": {
|
||||||
"avatar": {
|
"avatar": {
|
||||||
|
|
|
@ -21,7 +21,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type Account struct {
|
type Account struct {
|
||||||
ID int64 `json:"id"`
|
UUID string `json:"uuid"`
|
||||||
Login string `json:"username"`
|
Login string `json:"username"`
|
||||||
Name string `json:"display_name"`
|
Name string `json:"display_name"`
|
||||||
Type string `json:"type"`
|
Type string `json:"type"`
|
||||||
|
|
Loading…
Reference in a new issue