forked from github/plane
[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
@ -11,6 +11,11 @@ http {
|
|||||||
|
|
||||||
client_max_body_size ${FILE_SIZE_LIMIT};
|
client_max_body_size ${FILE_SIZE_LIMIT};
|
||||||
|
|
||||||
|
add_header X-Content-Type-Options "nosniff" always;
|
||||||
|
add_header Referrer-Policy "no-referrer-when-downgrade" always;
|
||||||
|
add_header Permissions-Policy "interest-cohort=()" always;
|
||||||
|
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://web:3000/;
|
proxy_pass http://web:3000/;
|
||||||
}
|
}
|
||||||
@ -20,6 +25,7 @@ http {
|
|||||||
}
|
}
|
||||||
|
|
||||||
location /spaces/ {
|
location /spaces/ {
|
||||||
|
rewrite ^/spaces/?$ /spaces/login break;
|
||||||
proxy_pass http://space:3000/spaces/;
|
proxy_pass http://space:3000/spaces/;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -27,4 +33,4 @@ http {
|
|||||||
proxy_pass http://plane-minio:9000/uploads/;
|
proxy_pass http://plane-minio:9000/uploads/;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ export const SignInView = observer(() => {
|
|||||||
const onSignInSuccess = (response: any) => {
|
const onSignInSuccess = (response: any) => {
|
||||||
const isOnboarded = response?.user?.onboarding_step?.profile_complete || false;
|
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);
|
userStore.setCurrentUser(response?.user);
|
||||||
|
|
||||||
@ -41,7 +41,7 @@ export const SignInView = observer(() => {
|
|||||||
router.push(`/onboarding?next_path=${nextPath}`);
|
router.push(`/onboarding?next_path=${nextPath}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
router.push((nextPath ?? "/").toString());
|
router.push((nextPath ?? "/login").toString());
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleGoogleSignIn = async ({ clientId, credential }: any) => {
|
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
|
// components
|
||||||
import { SignInView, UserLoggedIn } from "components/accounts";
|
import { SignInView, UserLoggedIn } from "components/accounts";
|
||||||
|
|
||||||
export const HomeView = observer(() => {
|
export const LoginView = observer(() => {
|
||||||
const { user: userStore } = useMobxStore();
|
const { user: userStore } = useMobxStore();
|
||||||
|
|
||||||
if (!userStore.currentUser) return <SignInView />;
|
if (!userStore.currentUser) return <SignInView />;
|
@ -1,8 +0,0 @@
|
|||||||
import React from "react";
|
|
||||||
|
|
||||||
// components
|
|
||||||
import { HomeView } from "components/views";
|
|
||||||
|
|
||||||
const HomePage = () => <HomeView />;
|
|
||||||
|
|
||||||
export default HomePage;
|
|
8
space/pages/login/index.tsx
Normal file
8
space/pages/login/index.tsx
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
import React from "react";
|
||||||
|
|
||||||
|
// components
|
||||||
|
import { LoginView } from "components/views";
|
||||||
|
|
||||||
|
const LoginPage = () => <LoginView />;
|
||||||
|
|
||||||
|
export default LoginPage;
|
Loading…
Reference in New Issue
Block a user