Revize 8c45ccb0
Přidáno uživatelem hrubyjar před asi 2 roky(ů)
webapp/pages/_app.tsx | ||
---|---|---|
1 |
import '../styles/globals.css' |
|
2 |
import type {AppProps} from 'next/app' |
|
1 |
// @ts-nocheck |
|
2 |
import '../styles/globals.css'; |
|
3 |
import 'bootstrap/dist/css/bootstrap.css'; |
|
3 | 4 |
|
4 |
import 'bootstrap/dist/css/bootstrap.css' |
|
5 |
import type { AppProps } from 'next/app'; |
|
6 |
import Head from 'next/head'; |
|
7 |
import { SecuredComponent } from '../components/types/auth'; |
|
8 |
import LoggedUserProvider from '../contexts/LoggedUserContext'; |
|
9 |
import Auth from '../components/common/Auth'; |
|
5 | 10 |
|
6 |
function MyApp({Component, pageProps}: AppProps) { |
|
7 |
return <Component {...pageProps} /> |
|
11 |
function MyApp({ |
|
12 |
Component, |
|
13 |
pageProps, |
|
14 |
}: { |
|
15 |
Component: SecuredComponent; |
|
16 |
pageProps: AppProps['pageProps']; |
|
17 |
}) { |
|
18 |
return ( |
|
19 |
<LoggedUserProvider> |
|
20 |
<Head> |
|
21 |
<link rel="shortcut icon" href={'/favicon.ico'} /> |
|
22 |
<title>Annotation Tool</title> |
|
23 |
</Head> |
|
24 |
{Component.auth ? ( |
|
25 |
<Auth minRole={Component.auth?.minRole}> |
|
26 |
<Component {...pageProps} /> |
|
27 |
</Auth> |
|
28 |
) : ( |
|
29 |
<Component {...pageProps} /> |
|
30 |
)} |
|
31 |
</LoggedUserProvider> |
|
32 |
); |
|
8 | 33 |
} |
9 | 34 |
|
10 |
export default MyApp |
|
35 |
export default MyApp; |
Také k dispozici: Unified diff
Token management implemented, redirections