Skip to content

Commit

Permalink
feat: add JWT token type (#101)
Browse files Browse the repository at this point in the history
* feat: Add JWT token type (#100)

* fix: Fix JWT token type
  • Loading branch information
pi-kei authored Feb 20, 2024
1 parent 0d6552f commit 3d0d3f1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions casdoorsdk/jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ type Claims struct {
User
AccessToken string `json:"accessToken"`
jwt.RegisteredClaims
TokenType string `json:"tokenType"`
RefreshTokenType string `json:"TokenType"`
}

// IsRefreshToken returns true if the token is a refresh token
func (c Claims) IsRefreshToken() bool {
return c.RefreshTokenType == "refresh-token"
}

func (c *Client) ParseJwtToken(token string) (*Claims, error) {
Expand Down

0 comments on commit 3d0d3f1

Please sign in to comment.