Skip to content

Commit

Permalink
fix: default to files:read scope for Figma provider (#1831)
Browse files Browse the repository at this point in the history
Closes #1827 by defaulting to `files:read` oAuth scope for Figma as per
the issue.
  • Loading branch information
smogg authored Nov 12, 2024
1 parent 7c3cf26 commit 9ce2857
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/api/external_figma_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func (ts *ExternalTestSuite) TestSignupExternalFigma() {
ts.Equal(ts.Config.External.Figma.RedirectURI, q.Get("redirect_uri"))
ts.Equal(ts.Config.External.Figma.ClientID, []string{q.Get("client_id")})
ts.Equal("code", q.Get("response_type"))
ts.Equal("file_read", q.Get("scope"))
ts.Equal("files:read", q.Get("scope"))

claims := ExternalProviderClaims{}
p := jwt.NewParser(jwt.WithValidMethods([]string{jwt.SigningMethodHS256.Name}))
Expand Down
3 changes: 1 addition & 2 deletions internal/api/provider/figma.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ func NewFigmaProvider(ext conf.OAuthProviderConfiguration, scopes string) (OAuth
authHost := chooseHost(ext.URL, defaultFigmaAuthBase)
apiHost := chooseHost(ext.URL, defaultFigmaAPIBase)

// Figma only provides the "file_read" scope.
oauthScopes := []string{
"file_read",
"files:read",
}

if scopes != "" {
Expand Down

0 comments on commit 9ce2857

Please sign in to comment.