mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-22 15:04:07 +01:00
🎨 Auto-close browser page when publish service is closed https://github.com/siyuan-note/siyuan/issues/16587#issuecomment-3698421929 (#16804)
This commit is contained in:
parent
1aaabefe05
commit
840fd99bbb
7 changed files with 97 additions and 3 deletions
|
|
@ -159,3 +159,15 @@ func GetClaimRole(claims jwt.MapClaims) Role {
|
|||
}
|
||||
return RoleVisitor
|
||||
}
|
||||
|
||||
// IsPublishServiceToken 检查 token 是否来自发布服务
|
||||
func IsPublishServiceToken(token *jwt.Token) bool {
|
||||
if token == nil || !token.Valid {
|
||||
return false
|
||||
}
|
||||
claims := GetTokenClaims(token)
|
||||
if tokenIssuer, ok := claims["iss"].(string); ok {
|
||||
return tokenIssuer == iss
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue