mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-08 07:37:38 +00:00
Same perl replacement as https://github.com/go-gitea/gitea/pull/25686 but for 1.20 to ease future backporting.
This commit is contained in:
parent
4e310133f9
commit
24e64fe372
233 changed files with 729 additions and 729 deletions
|
@ -41,7 +41,7 @@ type Token struct {
|
|||
|
||||
// ParseToken parses a signed jwt string
|
||||
func ParseToken(jwtToken string, signingKey JWTSigningKey) (*Token, error) {
|
||||
parsedToken, err := jwt.ParseWithClaims(jwtToken, &Token{}, func(token *jwt.Token) (interface{}, error) {
|
||||
parsedToken, err := jwt.ParseWithClaims(jwtToken, &Token{}, func(token *jwt.Token) (any, error) {
|
||||
if token.Method == nil || token.Method.Alg() != signingKey.SigningMethod().Alg() {
|
||||
return nil, fmt.Errorf("unexpected signing algo: %v", token.Header["alg"])
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue