Skip to content

Commit

Permalink
feat: allow passing state parameter in GetOAuthToken
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhaoYP-2001 committed Sep 20, 2024
1 parent 0e8233a commit b528f6d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion casdoorsdk/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ func (c *Client) GetOAuthToken(code string, state string) (*oauth2.Token, error)
Scopes: nil,
}

token, err := config.Exchange(context.Background(), code)
stateParam := oauth2.SetAuthURLParam("state", state)
token, err := config.Exchange(context.Background(), code, stateParam)
if err != nil {
return token, err
}
Expand Down

0 comments on commit b528f6d

Please sign in to comment.