temp
This commit is contained in:
@@ -15,6 +15,7 @@ export async function GET(
|
||||
let redirectTo: string
|
||||
|
||||
const returnUrl = request.headers.get("x-returnurl")
|
||||
console.log("TESTTEST", returnUrl, request)
|
||||
if (returnUrl) {
|
||||
// Seamless login request from Current web
|
||||
redirectTo = returnUrl
|
||||
@@ -32,7 +33,6 @@ export async function GET(
|
||||
}
|
||||
redirectTo = new URL(redirectTo, env.PUBLIC_URL).href
|
||||
}
|
||||
|
||||
// Clean up cookie from authRequired middleware
|
||||
redirectHeaders = new Headers()
|
||||
redirectHeaders.append(
|
||||
@@ -94,7 +94,7 @@ export async function GET(
|
||||
ui_locales: context.params.lang,
|
||||
}
|
||||
)
|
||||
|
||||
console.log(redirectUrl)
|
||||
if (redirectUrl) {
|
||||
return NextResponse.redirect(redirectUrl, {
|
||||
headers: redirectHeaders,
|
||||
|
||||
@@ -40,7 +40,7 @@ import type { MiddlewareMatcher } from "@/types/middleware"
|
||||
export const middleware = auth(async (request) => {
|
||||
const { nextUrl } = request
|
||||
const lang = findLang(nextUrl.pathname)!
|
||||
|
||||
console.log("TestTest ", nextUrl)
|
||||
const isLoggedIn = !!request.auth
|
||||
const hasError = request.auth?.error
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { NextResponse, type NextMiddleware } from "next/server"
|
||||
import { type NextMiddleware, NextResponse } from "next/server"
|
||||
|
||||
import { findLang } from "@/constants/languages"
|
||||
import { env } from "@/env/server"
|
||||
import { badRequest, internalServerError } from "@/server/errors/next"
|
||||
|
||||
import { decryptData } from "@/utils/aes"
|
||||
|
||||
import type { MiddlewareMatcher } from "@/types/middleware"
|
||||
|
||||
Reference in New Issue
Block a user