feat: fix Casbin Permissions Not Working When Auto-login is Enabled (#3537)

* fix: fix Casbin Permissions Not Working When Auto-login is Enabled

* fix: fix oauth fastLogin not support permission
This commit is contained in:
DacongDA
2025-01-28 19:15:53 +08:00
committed by GitHub
parent 558b168477
commit 5a78dcf06d

View File

@ -80,6 +80,15 @@ func fastAutoSignin(ctx *context.Context) (string, error) {
return "", nil
}
isAllowed, err := object.CheckLoginPermission(userId, application)
if err != nil {
return "", err
}
if !isAllowed {
return "", nil
}
code, err := object.GetOAuthCode(userId, clientId, responseType, redirectUri, scope, state, nonce, codeChallenge, ctx.Request.Host, getAcceptLanguage(ctx))
if err != nil {
return "", err