|
@@ -12,7 +12,7 @@ from app.api.base import api_bp
|
|
|
from app.config import FLASK_SECRET, DISABLE_REGISTRATION
|
|
|
from app.dashboard.views.setting import send_reset_password_email
|
|
|
from app.email_utils import (
|
|
|
- email_domain_can_be_used_as_mailbox,
|
|
|
+ email_can_be_used_as_mailbox,
|
|
|
personal_email_already_used,
|
|
|
send_email,
|
|
|
render,
|
|
@@ -89,9 +89,7 @@ def auth_register():
|
|
|
|
|
|
if DISABLE_REGISTRATION:
|
|
|
return jsonify(error="registration is closed"), 400
|
|
|
- if not email_domain_can_be_used_as_mailbox(email) or personal_email_already_used(
|
|
|
- email
|
|
|
- ):
|
|
|
+ if not email_can_be_used_as_mailbox(email) or personal_email_already_used(email):
|
|
|
return jsonify(error=f"cannot use {email} as personal inbox"), 400
|
|
|
|
|
|
if not password or len(password) < 8:
|
|
@@ -249,9 +247,9 @@ def auth_facebook():
|
|
|
if not user:
|
|
|
if DISABLE_REGISTRATION:
|
|
|
return jsonify(error="registration is closed"), 400
|
|
|
- if not email_domain_can_be_used_as_mailbox(
|
|
|
+ if not email_can_be_used_as_mailbox(email) or personal_email_already_used(
|
|
|
email
|
|
|
- ) or personal_email_already_used(email):
|
|
|
+ ):
|
|
|
return jsonify(error=f"cannot use {email} as personal inbox"), 400
|
|
|
|
|
|
LOG.d("create facebook user with %s", user_info)
|
|
@@ -302,9 +300,9 @@ def auth_google():
|
|
|
if not user:
|
|
|
if DISABLE_REGISTRATION:
|
|
|
return jsonify(error="registration is closed"), 400
|
|
|
- if not email_domain_can_be_used_as_mailbox(
|
|
|
+ if not email_can_be_used_as_mailbox(email) or personal_email_already_used(
|
|
|
email
|
|
|
- ) or personal_email_already_used(email):
|
|
|
+ ):
|
|
|
return jsonify(error=f"cannot use {email} as personal inbox"), 400
|
|
|
|
|
|
LOG.d("create Google user with %s", user_info)
|