[fix] nginx continuously rewriting and reloading on index page of spaces app (#2236)
* chore: shifted index page to /home route * chore: added rewrite logic, to rewrite index to /home * chore: routed home to login route as login page * chore: updated nginx config to route to login * chore: updated path for home
This commit is contained in:
parent
d38594376b
commit
88a35efa06
6 changed files with 19 additions and 13 deletions
|
|
@ -33,7 +33,7 @@ export const SignInView = observer(() => {
|
|||
const onSignInSuccess = (response: any) => {
|
||||
const isOnboarded = response?.user?.onboarding_step?.profile_complete || false;
|
||||
|
||||
const nextPath = router.asPath.includes("next_path") ? router.asPath.split("/?next_path=")[1] : "/";
|
||||
const nextPath = router.asPath.includes("next_path") ? router.asPath.split("/?next_path=")[1] : "/login";
|
||||
|
||||
userStore.setCurrentUser(response?.user);
|
||||
|
||||
|
|
@ -41,7 +41,7 @@ export const SignInView = observer(() => {
|
|||
router.push(`/onboarding?next_path=${nextPath}`);
|
||||
return;
|
||||
}
|
||||
router.push((nextPath ?? "/").toString());
|
||||
router.push((nextPath ?? "/login").toString());
|
||||
};
|
||||
|
||||
const handleGoogleSignIn = async ({ clientId, credential }: any) => {
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
export * from "./home";
|
||||
export * from "./login";
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { useMobxStore } from "lib/mobx/store-provider";
|
|||
// components
|
||||
import { SignInView, UserLoggedIn } from "components/accounts";
|
||||
|
||||
export const HomeView = observer(() => {
|
||||
export const LoginView = observer(() => {
|
||||
const { user: userStore } = useMobxStore();
|
||||
|
||||
if (!userStore.currentUser) return <SignInView />;
|
||||
Loading…
Add table
Add a link
Reference in a new issue