Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
get_plugin_settings,
)
from ._rest_dependencies import get_confirmation_service
from ._rest_exceptions import handle_rest_requests_exceptions
from .registration_schemas import (
InvitationCheck,
InvitationInfo,
Expand All @@ -73,6 +74,7 @@
name="auth_check_registration_invitation",
)
@global_rate_limit_route(number_of_requests=30, interval_seconds=MINUTE)
@handle_rest_requests_exceptions
async def check_registration_invitation(request: web.Request):
"""
Decrypts invitation and extracts associated email or
Expand Down Expand Up @@ -103,6 +105,7 @@ async def check_registration_invitation(request: web.Request):


@routes.post(f"/{API_VTAG}/auth/register", name="auth_register")
@handle_rest_requests_exceptions
async def register(request: web.Request):
"""
Starts user's registration by providing an email, password and
Expand Down Expand Up @@ -309,6 +312,7 @@ async def register(request: web.Request):
name="auth_resend_2fa_code",
max_access_count=MAX_2FA_CODE_RESEND,
)
@handle_rest_requests_exceptions
async def register_phone(request: web.Request):
"""
Submits phone registration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"A verification code has been sent via SMS to {phone_number}.", _version=1
)
MSG_2FA_UNAVAILABLE: Final[str] = user_message(
"Two-factor authentication is temporarily unavailable. Please try again later.",
_version=1,
"The two-factor authentication service is currently unavailable. Please try again in a few minutes.",
_version=2,
)
MSG_ACTIVATED: Final[str] = user_message(
"Your account has been successfully activated.", _version=1
Expand All @@ -17,8 +17,8 @@
_version=1,
)
MSG_AUTH_FAILED: Final[str] = user_message(
"We couldn't sign you in with those credentials. Please check your email and password and try again.",
_version=1,
"The provided credentials are incorrect. Please verify your email and password.",
_version=2,
)
MSG_CANT_SEND_MAIL: Final[str] = user_message(
"We're unable to send emails at this time. Please try again later.", _version=1
Expand Down Expand Up @@ -99,17 +99,19 @@
_version=2,
)
MSG_WRONG_2FA_CODE__EXPIRED: Final[str] = user_message(
"The verification code is either incorrect or has expired. Please request a new verification code and try again.",
_version=3,
"The verification code has expired or is incorrect. Please request a new code and try again.",
_version=4,
)
MSG_WRONG_CAPTCHA__INVALID: Final[str] = user_message(
"The CAPTCHA entered is incorrect. Please try again.", _version=1
)
MSG_WRONG_PASSWORD: Final[str] = user_message(
"The password is incorrect. Please try again.", _version=1
"The password does not match the one associated with this email address. Please try again.",
_version=3,
)
MSG_WEAK_PASSWORD: Final[str] = user_message(
"Password must be at least {LOGIN_PASSWORD_MIN_LENGTH} characters long.", _version=1
"Your password must contain at least {LOGIN_PASSWORD_MIN_LENGTH} characters for security.",
_version=2,
)
MSG_INVITATIONS_CONTACT_SUFFIX: Final[str] = user_message(
"Please contact our support team to request a new invitation.", _version=1
Expand Down
Loading