feature restriction supports OAuth 2.0 login and unlinking third-party login

This commit is contained in:
MaysWind
2025-10-25 15:50:25 +08:00
parent 8584e84af9
commit 4823760fd1
4 changed files with 21 additions and 1 deletions
+4
View File
@@ -87,6 +87,10 @@ func (a *UserExternalAuthsApi) UnlinkExternalAuthHandler(c *core.WebContext) (an
return nil, errs.ErrUserPasswordWrong
}
if user.FeatureRestriction.Contains(core.USER_FEATURE_RESTRICTION_TYPE_UNLINK_THIRD_PARTY_LOGIN) {
return nil, errs.ErrNotPermittedToPerformThisAction
}
externalAuthType := core.UserExternalAuthType(externalAuthLinkReq.ExternalAuthType)
if !externalAuthType.IsValid() {