mirror of
https://github.com/dsoaress/link-free.git
synced 2026-08-16 22:46:04 +01:00
fix: refresh token
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import { prisma } from 'services/prisma'
|
import { prisma } from 'services/prisma'
|
||||||
// import { authMiddleware } from '../../utils/authMiddleware'
|
|
||||||
import { ExceptionError } from 'utils/error'
|
import { ExceptionError } from 'utils/error'
|
||||||
import { nc } from 'utils/nc'
|
import { nc } from 'utils/nc'
|
||||||
|
import { authMiddleware } from 'utils/authMiddleware'
|
||||||
|
|
||||||
const handler = nc
|
const handler = nc
|
||||||
.get(async (_req, res) => {
|
.get(async (_req, res) => {
|
||||||
@@ -15,7 +15,7 @@ const handler = nc
|
|||||||
|
|
||||||
res.status(200).json(response?.data)
|
res.status(200).json(response?.data)
|
||||||
})
|
})
|
||||||
// .use(authMiddleware)
|
.use(authMiddleware)
|
||||||
.put(async (req, res) => {
|
.put(async (req, res) => {
|
||||||
const { data } = req.body
|
const { data } = req.body
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ export function setupAPIClient(ctx: GetServerSidePropsContext | undefined = unde
|
|||||||
isRefreshing = true
|
isRefreshing = true
|
||||||
|
|
||||||
api
|
api
|
||||||
.post('session/refresh-token', { refreshToken })
|
.post('auth/refresh-token', { refreshToken })
|
||||||
.then(response => {
|
.then(response => {
|
||||||
const { accessToken, refreshToken } = response.data
|
const { accessToken, refreshToken } = response.data
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user