Skip to content

Commit

Permalink
ok
Browse files Browse the repository at this point in the history
  • Loading branch information
digitaldesigndj committed Mar 9, 2023
1 parent 66a1d08 commit 9e46baf
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions routes/_middleware.js
Expand Up @@ -34,7 +34,7 @@ const createSession = async () => {
const setupNewSession = async (req, ctx) => {
ctx.state = await createSession()
ctx.REDIS_KEY = REDIS_KEY(ctx.state[COOKIE_NAME])
// setupState(req, ctx)
setupStateHook(req, ctx)
const resp = await ctx.next()
setCookie(resp.headers, {
name: COOKIE_NAME,
Expand All @@ -57,17 +57,15 @@ const setupSession = async (req, ctx) => {
} else {
return await setupNewSession(req, ctx)
}
// setupState(req, ctx)
setupStateHook(req, ctx)
return await ctx.next()
}

// const setupState = (req, ctx) => {
// // If you are behind NGINX or something, this can be helpful
// // req.url.replace("http:", "https:");
// // const url = new URL(req.url)
// // ctx.state.url = url
// return
// }
const setupStateHook = (_req, _ctx) => {
// const url = new URL(req.url)
// ctx.state.url = url
return
}

export async function handler(req, ctx) {
// For Logging
Expand Down

0 comments on commit 9e46baf

Please sign in to comment.