forked from github/plane
[WEB-1328] chore: magic sign-in redirection (#4470)
* chore: magic signin redirection * chore: expired magic code error message
This commit is contained in:
parent
0b84142dce
commit
b14d44049c
@ -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)},
|
||||||
)
|
)
|
||||||
|
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user