fix: use FRONTEND_URL for redirects behind proxy
Build and Deploy / test-backend (push) Successful in 55s
Build and Deploy / lint-frontend (push) Successful in 12s
Build and Deploy / build-backend (push) Successful in 3s
Build and Deploy / build-frontend (push) Successful in 29s
Build and Deploy / deploy (push) Successful in 5s
Build and Deploy / test-backend (push) Successful in 55s
Build and Deploy / lint-frontend (push) Successful in 12s
Build and Deploy / build-backend (push) Successful in 3s
Build and Deploy / build-frontend (push) Successful in 29s
Build and Deploy / deploy (push) Successful in 5s
This commit is contained in:
@@ -11,9 +11,11 @@ export async function GET(req: Request) {
|
||||
const storedState = cookieStore.get("oauth_state")?.value;
|
||||
const verifier = cookieStore.get("oauth_verifier")?.value;
|
||||
|
||||
const origin = new URL(process.env.FRONTEND_URL ?? "http://localhost:3000").origin;
|
||||
|
||||
const fail = (reason: string) => {
|
||||
const response = NextResponse.redirect(
|
||||
new URL(`/oauth/error?reason=${reason}`, url.origin)
|
||||
new URL(`/oauth/error?reason=${reason}`, origin)
|
||||
);
|
||||
response.cookies.delete("oauth_verifier");
|
||||
response.cookies.delete("oauth_state");
|
||||
@@ -47,7 +49,7 @@ export async function GET(req: Request) {
|
||||
|
||||
const { session_token } = await sessionResponse.json();
|
||||
|
||||
const response = NextResponse.redirect(new URL("/collections", url.origin));
|
||||
const response = NextResponse.redirect(new URL("/collections", origin));
|
||||
|
||||
response.cookies.set("session", session_token, {
|
||||
httpOnly: true,
|
||||
|
||||
Reference in New Issue
Block a user