generate API token in frontend page

This commit is contained in:
MaysWind
2025-11-03 01:27:45 +08:00
parent bb84e8af13
commit b0e01d36ab
38 changed files with 770 additions and 303 deletions
+1 -1
View File
@@ -149,7 +149,7 @@ func jwtAuthorization(c *core.WebContext, source TokenSourceType) {
return
}
if claims.Type != core.USER_TOKEN_TYPE_NORMAL {
if claims.Type != core.USER_TOKEN_TYPE_NORMAL && claims.Type != core.USER_TOKEN_TYPE_API {
log.Warnf(c, "[authorization.jwtAuthorization] user \"uid:%d\" token type (%d) is invalid", claims.Uid, claims.Type)
utils.PrintJsonErrorResult(c, errs.ErrCurrentInvalidTokenType)
return