chore: add env var for social login (#7251)

This commit is contained in:
Pablo Lara
2025-03-17 10:23:01 +01:00
committed by Pepe Fagoaga
parent d1f04fefb0
commit c1e36f0df7
4 changed files with 9 additions and 5 deletions
+3 -2
View File
@@ -3,6 +3,7 @@
import { NextResponse } from "next/server";
import { signIn } from "@/auth.config";
import { baseUrl } from "@/lib/helper";
export async function GET(req: Request) {
const { searchParams } = new URL(req.url);
@@ -42,14 +43,14 @@ export async function GET(req: Request) {
accessToken: access,
refreshToken: refresh,
redirect: false,
callbackUrl: "/",
callbackUrl: `${baseUrl}/`,
});
if (result?.error) {
throw new Error(result.error);
}
return NextResponse.redirect(new URL("/", req.url));
return NextResponse.redirect(new URL("/", baseUrl));
} catch (error) {
// eslint-disable-next-line no-console
console.error("SignIn error:", error);