fix: Fixed jwt imports
This commit is contained in:
parent
12e92b8106
commit
11a59d39af
@ -4,9 +4,9 @@ export default defineNuxtRouteMiddleware(async (to) => {
|
||||
}
|
||||
|
||||
try {
|
||||
const user = await $fetch('/api/auth/user')
|
||||
const user = await $fetch('/api/users/@me')
|
||||
|
||||
if (!user.id) {
|
||||
if (!user._id) {
|
||||
throw createError({ statusCode: 500, statusMessage: 'No user was found' })
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as jwt from 'jsonwebtoken'
|
||||
import jwt from 'jsonwebtoken' //eslint-disable-line
|
||||
|
||||
type AccessTokenResponse = {
|
||||
access_token: string,
|
||||
|
@ -3,5 +3,6 @@
|
||||
"extends": "./.nuxt/tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"typeRoots": ["./types"]
|
||||
}
|
||||
},
|
||||
"esModuleInterop": true
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user