[WEB-1328] chore: magic sign-in redirection (#4470)

* chore: magic signin redirection

* chore: expired magic code error message
This commit is contained in:
Bavisetti Narayan 2024-05-15 22:10:47 +05:30 committed by GitHub
parent 0b84142dce
commit b14d44049c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -135,8 +135,10 @@ class MagicCodeProvider(CredentialAdapter):
payload={"email": str(email)}, payload={"email": str(email)},
) )
else: else:
magic_key = str(self.key)
email = magic_key.replace("magic_", "", 1)
raise AuthenticationException( raise AuthenticationException(
error_code=AUTHENTICATION_ERROR_CODES["EXPIRED_MAGIC_CODE"], error_code=AUTHENTICATION_ERROR_CODES["EXPIRED_MAGIC_CODE"],
error_message="EXPIRED_MAGIC_CODE", error_message="EXPIRED_MAGIC_CODE",
payload={"email": str(self.key)}, payload={"email": str(email)},
) )

View File

@ -145,7 +145,7 @@ class MagicSignInEndpoint(View):
path = ( path = (
str(next_path) str(next_path)
if next_path if next_path
else str(process_workspace_project_invitations(user=user)) else str(get_redirection_path(user=user))
) )
# redirect to referer path # redirect to referer path
url = urljoin(base_host(request=request, is_app=True), path) url = urljoin(base_host(request=request, is_app=True), path)