Skip to content

Commit 3110a17

Browse files
committed
redirectをlocalePathにする
1 parent e751665 commit 3110a17

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/middleware/authenticated.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { Middleware } from '@nuxt/types'
22
import { withSSRContext } from 'aws-amplify'
33

4-
const authenticated: Middleware = async ({ redirect }) => {
4+
const authenticated: Middleware = async ({ redirect, localePath }) => {
55
const { Auth } = withSSRContext()
66
const userInfo = await Auth.currentUserInfo()
77

88
if (!userInfo) {
9-
redirect('/user/login')
9+
redirect(localePath('/user/login'))
1010
}
1111
}
1212

src/middleware/checkClassData.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { Middleware } from '@nuxt/types'
22
import { vxm } from '@/store'
33

4-
const checkClassData: Middleware = ({ redirect }) => {
4+
const checkClassData: Middleware = ({ redirect, localePath }) => {
55
if (!vxm.classData.isLoaded) {
6-
return redirect('/')
6+
return redirect(localePath('/'))
77
}
88
}
99

0 commit comments

Comments
 (0)