Skip to content

Commit

Permalink
fix: forgot prettier (format)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmmoran committed Dec 2, 2023
1 parent 59dab33 commit ea1da66
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/next-edge/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { IncomingHttpHeaders } from "http"
import { Buffer } from "buffer"
import { isText } from "istextorbinary"
import tldjs from "tldjs"
import {useRouter} from "next/router";
import { useRouter } from "next/router"

export function filterRequestHeaders(
headers: IncomingHttpHeaders,
Expand Down Expand Up @@ -137,9 +137,10 @@ export function createApiHandler(options: CreateApiHandlerOptions) {

const path = Array.isArray(paths) ? paths.join("/") : paths
const url = `${baseUrl}/${path}?${search.toString()}`
const basePathNoLeadingSlash = basePath.length > 1 ? basePath.substring(1) : ""
const basePathNoLeadingSlash =
basePath.length > 1 ? basePath.substring(1) : ""

if (path === `${[basePathNoLeadingSlash, 'ui', 'welcome'].join('/')}`) {
if (path === `${[basePathNoLeadingSlash, "ui", "welcome"].join("/")}`) {
// A special for redirecting to the home page
// if we were being redirected to the hosted UI
// welcome page.
Expand Down Expand Up @@ -182,11 +183,13 @@ export function createApiHandler(options: CreateApiHandlerOptions) {
`${basePath}/api/.ory`,
)
} else if (
res.headers.location.indexOf(`${basePath}/api/kratos/public/`) === 0 ||
res.headers.location.indexOf(`${basePath}/api/kratos/public/`) ===
0 ||
res.headers.location.indexOf(`${basePath}/self-service/`) === 0 ||
res.headers.location.indexOf(`${basePath}/ui/`) === 0
) {
res.headers.location = `${basePath}/api/.ory` + res.headers.location
res.headers.location =
`${basePath}/api/.ory` + res.headers.location
}
}

Expand Down

0 comments on commit ea1da66

Please sign in to comment.