feat: add file upload

This commit is contained in:
Daniel Soares
2021-12-26 01:02:23 -03:00
parent 165c26af3f
commit db0a21e4a0
23 changed files with 407 additions and 124 deletions

View File

@@ -1,6 +1,6 @@
import jwt from 'jsonwebtoken'
import { authConstants } from 'constants/auth'
import { env } from 'constants/env'
import { ExceptionError } from 'utils/error'
import type { NextApiRequest, NextApiResponse } from 'next'
@@ -12,7 +12,7 @@ type Token = {
}
export async function authMiddleware(req: NextApiRequest, _res: NextApiResponse, next: () => void) {
const { JWT_SECRET } = authConstants
const { JWT_SECRET } = env
const token = req.headers['authorization']
if (!token) {