fix: Fixed jwt imports

This commit is contained in:
Xeovalyte 2023-06-05 14:55:35 +02:00
parent 12e92b8106
commit 11a59d39af
3 changed files with 5 additions and 4 deletions

View File

@ -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' })
}

View File

@ -1,4 +1,4 @@
import * as jwt from 'jsonwebtoken'
import jwt from 'jsonwebtoken' //eslint-disable-line
type AccessTokenResponse = {
access_token: string,

View File

@ -3,5 +3,6 @@
"extends": "./.nuxt/tsconfig.json",
"compilerOptions": {
"typeRoots": ["./types"]
}
},
"esModuleInterop": true
}