mirror of https://github.com/langgenius/dify.git
feat: add ALLOW_REGISTER judgement in _generate_account
This commit is contained in:
parent
1f8bad9bf6
commit
b46bb3e7a4
|
|
@ -123,6 +123,8 @@ def _generate_account(provider: str, user_info: OAuthUserInfo):
|
|||
account = _get_account_by_openid_or_email(provider, user_info)
|
||||
|
||||
if not account:
|
||||
if not dify_config.ALLOW_REGISTER:
|
||||
raise Unauthorized("Account not found")
|
||||
account_name = user_info.name if user_info.name else "Dify"
|
||||
account = RegisterService.register(
|
||||
email=user_info.email, name=account_name, password=None, open_id=user_info.id, provider=provider
|
||||
|
|
|
|||
Loading…
Reference in New Issue