Skip to content

Commit

Permalink
fix: Fix 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 de7a122 commit 4296184
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions casdoorsdk/jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ type Claims struct {
User
AccessToken string `json:"accessToken"`
jwt.RegisteredClaims
TokenType string `json:"TokenType"`
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.TokenType == "refresh-token"
return c.RefreshTokenType == "refresh-token"
}

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

0 comments on commit 4296184

Please sign in to comment.