mirror of
https://github.com/getAlby/hub.git
synced 2026-08-13 12:33:39 +02:00
fix: use dynamic JWT key func (#1552)
This commit is contained in:
parent
b2fc5335c6
commit
5dbb67ff44
1 changed files with 4 additions and 1 deletions
|
|
@ -111,7 +111,10 @@ func (httpSvc *HttpService) RegisterSharedRoutes(e *echo.Echo) {
|
|||
NewClaimsFunc: func(c echo.Context) jwt.Claims {
|
||||
return new(jwtCustomClaims)
|
||||
},
|
||||
SigningKey: []byte(httpSvc.cfg.GetJWTSecret()),
|
||||
// use a custom key func as the JWT secret will change if the user changes their unlock password
|
||||
KeyFunc: func(token *jwt.Token) (interface{}, error) {
|
||||
return []byte(httpSvc.cfg.GetJWTSecret()), nil
|
||||
},
|
||||
}
|
||||
restrictedApiGroup := e.Group("/api")
|
||||
restrictedApiGroup.Use(echojwt.WithConfig(jwtConfig))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue