Skip to content

Commit

Permalink
feat: Add JWT token type
Browse files Browse the repository at this point in the history
  • Loading branch information
pi-kei committed Feb 20, 2024
1 parent 0d6552f commit 5426461
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions casdoorsdk/jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ type Claims struct {
User
AccessToken string `json:"accessToken"`
jwt.RegisteredClaims
TokenType string `json:"TokenType"`
}

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

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

0 comments on commit 5426461

Please sign in to comment.