mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-01-25 02:08:11 +00:00
chore: add env var for social login (#7251)
This commit is contained in:
2
.env
2
.env
@@ -4,7 +4,7 @@
|
||||
|
||||
#### Prowler UI Configuration ####
|
||||
PROWLER_UI_VERSION="stable"
|
||||
SITE_URL=http://localhost:3000
|
||||
AUTH_URL=http://localhost:3000
|
||||
API_BASE_URL=http://prowler-api:8080/api/v1
|
||||
NEXT_PUBLIC_API_DOCS_URL=http://prowler-api:8080/api/v1/docs
|
||||
AUTH_TRUST_HOST=true
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { getTask } from "@/actions/task";
|
||||
import { AuthSocialProvider, MetaDataProps, PermissionInfo } from "@/types";
|
||||
|
||||
export const baseUrl = process.env.AUTH_URL || "http://localhost:3000";
|
||||
|
||||
export const getAuthUrl = (provider: AuthSocialProvider) => {
|
||||
const config = {
|
||||
google: {
|
||||
|
||||
Reference in New Issue
Block a user