File tree Expand file tree Collapse file tree 4 files changed +45
-7
lines changed Expand file tree Collapse file tree 4 files changed +45
-7
lines changed Original file line number Diff line number Diff line change 1
1
# .env file
2
2
.env
3
-
3
+ .gitignore
4
4
# dependencies
5
5
/node_modules
6
6
/.pnp
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env sh
2
+ if [ -z " $husky_skip_init " ]; then
3
+ debug () {
4
+ if [ " $HUSKY_DEBUG " = " 1" ]; then
5
+ echo " husky (debug) - $1 "
6
+ fi
7
+ }
8
+
9
+ readonly hook_name=" $( basename -- " $0 " ) "
10
+ debug " starting $hook_name ..."
11
+
12
+ if [ " $HUSKY " = " 0" ]; then
13
+ debug " HUSKY env variable is set to 0, skipping hook"
14
+ exit 0
15
+ fi
16
+
17
+ if [ -f ~ /.huskyrc ]; then
18
+ debug " sourcing ~/.huskyrc"
19
+ . ~ /.huskyrc
20
+ fi
21
+
22
+ readonly husky_skip_init=1
23
+ export husky_skip_init
24
+ sh -e " $0 " " $@ "
25
+ exitCode=" $? "
26
+
27
+ if [ $exitCode != 0 ]; then
28
+ echo " husky - $hook_name hook exited with code $exitCode (error)"
29
+ fi
30
+
31
+ if [ $exitCode = 127 ]; then
32
+ echo " husky - command not found in PATH=$PATH "
33
+ fi
34
+
35
+ exit $exitCode
36
+ fi
Original file line number Diff line number Diff line change 1
1
import { useSession , signIn } from 'next-auth/react' ;
2
2
import { useLayoutEffect } from 'react' ;
3
3
import router from 'next/router' ;
4
+ import { AuthenticatedPage } from '@lib/types' ;
4
5
5
6
type WithAuthProps = {
6
7
children : React . ReactNode ;
7
- options ?: {
8
- redirectTo ?: string ;
9
- } ;
8
+ options ?: AuthenticatedPage ;
10
9
} ;
11
10
12
11
const WithAuth = ( { children, options } : WithAuthProps ) => {
Original file line number Diff line number Diff line change @@ -13,9 +13,12 @@ const queryClient = new QueryClient();
13
13
const MyApp = ( { Component, pageProps } : ExtendedAppProps ) => {
14
14
const AnyComponent = Component as any ;
15
15
const content = Component . auth ? (
16
- < WithAuth options = { Component . auth } >
17
- < AnyComponent { ...pageProps } />
18
- </ WithAuth >
16
+ < >
17
+ { /* @ts -expect-error Server Component */ }
18
+ < WithAuth options = { Component . auth } >
19
+ < AnyComponent { ...pageProps } />
20
+ </ WithAuth >
21
+ </ >
19
22
) : (
20
23
< AnyComponent { ...pageProps } />
21
24
) ;
You can’t perform that action at this time.
0 commit comments