fix: refresh token

This commit is contained in:
Daniel Soares
2021-12-19 22:40:57 -03:00
parent 661720f8cd
commit be9758fd57
2 changed files with 3 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
import { prisma } from 'services/prisma'
// import { authMiddleware } from '../../utils/authMiddleware'
import { ExceptionError } from 'utils/error'
import { nc } from 'utils/nc'
import { authMiddleware } from 'utils/authMiddleware'
const handler = nc
.get(async (_req, res) => {
@@ -15,7 +15,7 @@ const handler = nc
res.status(200).json(response?.data)
})
// .use(authMiddleware)
.use(authMiddleware)
.put(async (req, res) => {
const { data } = req.body

View File

@@ -35,7 +35,7 @@ export function setupAPIClient(ctx: GetServerSidePropsContext | undefined = unde
isRefreshing = true
api
.post('session/refresh-token', { refreshToken })
.post('auth/refresh-token', { refreshToken })
.then(response => {
const { accessToken, refreshToken } = response.data