Skip to content

Commit

Permalink
fix: Revert "fix: remove organizations from fly provider" (#1287)
Browse files Browse the repository at this point in the history
This reverts commit ef0614b.
* Reverts this PR: #1267
  • Loading branch information
kangmingtay authored Oct 30, 2023
1 parent 2385212 commit 84e16ed
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions internal/api/provider/fly.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,18 @@ type flyProvider struct {
}

type flyUser struct {
ResourceOwnerID string `json:"resource_owner_id"`
UserID string `json:"user_id"`
UserName string `json:"user_name"`
Email string `json:"email"`
Scope []string `json:"scope"`
Application map[string]string `json:"application"`
ExpiresIn int `json:"expires_in"`
CreatedAt int `json:"created_at"`
ResourceOwnerID string `json:"resource_owner_id"`
UserID string `json:"user_id"`
UserName string `json:"user_name"`
Email string `json:"email"`
Organizations []struct {
ID string `json:"id"`
Role string `json:"role"`
} `json:"organizations"`
Scope []string `json:"scope"`
Application map[string]string `json:"application"`
ExpiresIn int `json:"expires_in"`
CreatedAt int `json:"created_at"`
}

// NewFlyProvider creates a Fly oauth provider.
Expand Down Expand Up @@ -86,6 +90,7 @@ func (p flyProvider) GetUserData(ctx context.Context, tok *oauth2.Token) (*UserP
ProviderId: u.UserID,
CustomClaims: map[string]interface{}{
"resource_owner_id": u.ResourceOwnerID,
"organizations": u.Organizations,
"application": u.Application,
"scope": u.Scope,
"created_at": u.CreatedAt,
Expand Down

0 comments on commit 84e16ed

Please sign in to comment.