Add TokenFormat to application.

This commit is contained in:
Gucheng Wang
2021-12-18 16:16:34 +08:00
parent cb625b3fa2
commit 95f2a3b311
4 changed files with 19 additions and 0 deletions

View File

@ -55,6 +55,10 @@ func generateJwtToken(application *Application, user *User, nonce string) (strin
},
}
if application.TokenFormat == "JWT-Empty" {
claims.User = User{}
}
token := jwt.NewWithClaims(jwt.SigningMethodRS256, claims)
// Use "token_jwt_key.key" as RSA private key