🎨 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:
Jeffrey Chen 2026-01-10 19:47:30 +08:00 committed by GitHub
parent 1aaabefe05
commit 840fd99bbb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 97 additions and 3 deletions

View file

@ -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
}