mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
chore: backend redirection
This commit is contained in:
parent
d26c2fd6de
commit
75f6f643ac
@ -52,6 +52,7 @@ export const InstanceWrapper: FC<TInstanceWrapper> = observer((props) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (instance?.instance?.is_setup_done && pageType === EInstancePageType.PRE_SETUP) redirect("/");
|
if (instance?.instance?.is_setup_done && pageType === EInstancePageType.PRE_SETUP) redirect("/");
|
||||||
|
|
||||||
if (!instance?.instance?.is_setup_done && pageType === EInstancePageType.POST_SETUP) redirect("/setup");
|
if (!instance?.instance?.is_setup_done && pageType === EInstancePageType.POST_SETUP) redirect("/setup");
|
||||||
|
|
||||||
return <>{children}</>;
|
return <>{children}</>;
|
||||||
|
@ -122,9 +122,18 @@ class MagicSignInSpaceEndpoint(View):
|
|||||||
# Login the user and record his device info
|
# Login the user and record his device info
|
||||||
user_login(request=request, user=user)
|
user_login(request=request, user=user)
|
||||||
# redirect to referer path
|
# redirect to referer path
|
||||||
|
if user.is_password_autoset and profile.is_onboarded:
|
||||||
|
path = "spaces/accounts/set-password"
|
||||||
|
else:
|
||||||
|
# Get the redirection path
|
||||||
|
path = (
|
||||||
|
str(next_path)
|
||||||
|
if next_path
|
||||||
|
else "spaces"
|
||||||
|
)
|
||||||
url = urljoin(
|
url = urljoin(
|
||||||
base_host(request=request),
|
base_host(request=request),
|
||||||
str(next_path) if next_path else "spaces",
|
path
|
||||||
)
|
)
|
||||||
return HttpResponseRedirect(url)
|
return HttpResponseRedirect(url)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user