diff --git a/server/index.js b/server/index.js index abe500eb7..126a079fd 100644 --- a/server/index.js +++ b/server/index.js @@ -2,9 +2,11 @@ const express = require('express') const consola = require('consola') const { Nuxt, Builder } = require('nuxt') const app = express() + +require('dotenv').config() // + const host = process.env.HOST || '127.0.0.1' const port = process.env.PORT || 3000 - app.set('port', port) // Import and Set Nuxt.js options diff --git a/store/auth.js b/store/auth.js index 956ba8f83..a6ab3b3f8 100644 --- a/store/auth.js +++ b/store/auth.js @@ -58,12 +58,7 @@ export const actions = { return } - const payload = await jwt.verify( - token, - process.server - ? require('dotenv').parse(require('fs').readFileSync('.env')).JWT_SECRET - : null - ) + const payload = await jwt.verify(token, process.env.JWT_SECRET) if (!payload.id) { return }