File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
1
import { Middleware } from '@nuxt/types'
2
2
import { withSSRContext } from 'aws-amplify'
3
3
4
- const authenticated : Middleware = async ( { redirect } ) => {
4
+ const authenticated : Middleware = async ( { redirect, localePath } ) => {
5
5
const { Auth } = withSSRContext ( )
6
6
const userInfo = await Auth . currentUserInfo ( )
7
7
8
8
if ( ! userInfo ) {
9
- redirect ( '/user/login' )
9
+ redirect ( localePath ( '/user/login' ) )
10
10
}
11
11
}
12
12
Original file line number Diff line number Diff line change 1
1
import { Middleware } from '@nuxt/types'
2
2
import { vxm } from '@/store'
3
3
4
- const checkClassData : Middleware = ( { redirect } ) => {
4
+ const checkClassData : Middleware = ( { redirect, localePath } ) => {
5
5
if ( ! vxm . classData . isLoaded ) {
6
- return redirect ( '/' )
6
+ return redirect ( localePath ( '/' ) )
7
7
}
8
8
}
9
9
You can’t perform that action at this time.
0 commit comments