File tree Expand file tree Collapse file tree 4 files changed +12
-7
lines changed
src/frontend/apps/impress/src Expand file tree Collapse file tree 4 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { PropsWithChildren } from 'react';
5
5
import { Box } from '@/components' ;
6
6
import { useConfig } from '@/core' ;
7
7
8
+ import { HOME_URL } from '../conf' ;
8
9
import { useAuth } from '../hooks' ;
9
10
import { getAuthUrl , gotoLogin } from '../utils' ;
10
11
@@ -43,7 +44,7 @@ export const Auth = ({ children }: PropsWithChildren) => {
43
44
*/
44
45
if ( ! authenticated && ! pathAllowed ) {
45
46
if ( config ?. FRONTEND_HOMEPAGE_FEATURE_ENABLED ) {
46
- void replace ( '/home' ) ;
47
+ void replace ( HOME_URL ) ;
47
48
} else {
48
49
gotoLogin ( ) ;
49
50
}
@@ -57,7 +58,7 @@ export const Auth = ({ children }: PropsWithChildren) => {
57
58
/**
58
59
* If the user is authenticated and the path is the home page, we redirect to the index.
59
60
*/
60
- if ( pathname === '/home' && authenticated ) {
61
+ if ( pathname === HOME_URL && authenticated ) {
61
62
void replace ( '/' ) ;
62
63
return (
63
64
< Box $height = "100vh" $width = "100vw" $align = "center" $justify = "center" >
Original file line number Diff line number Diff line change 1
1
import { baseApiUrl } from '@/api' ;
2
2
3
- export const PATH_AUTH_LOCAL_STORAGE = 'docs-path-auth ' ;
3
+ export const HOME_URL = '/home ' ;
4
4
export const LOGIN_URL = `${ baseApiUrl ( ) } authenticate/` ;
5
5
export const LOGOUT_URL = `${ baseApiUrl ( ) } logout/` ;
6
+ export const PATH_AUTH_LOCAL_STORAGE = 'docs-path-auth' ;
Original file line number Diff line number Diff line change 1
1
export * from './api' ;
2
2
export * from './components' ;
3
+ export * from './conf' ;
3
4
export * from './hooks' ;
4
5
export * from './utils' ;
Original file line number Diff line number Diff line change 1
- import { HomeContent } from '@/features/home' ;
2
- import { NextPageWithLayout } from '@/types/next' ;
1
+ import { useRouter } from 'next/router' ;
3
2
4
- const Page : NextPageWithLayout = ( ) => {
5
- return < HomeContent /> ;
3
+ import { HOME_URL } from '@/features/auth' ;
4
+
5
+ const Page = ( ) => {
6
+ const { replace } = useRouter ( ) ;
7
+ void replace ( HOME_URL ) ;
6
8
} ;
7
9
8
10
export default Page ;
You can’t perform that action at this time.
0 commit comments