mirror of
https://github.com/PeterMaquiran/tvone.git
synced 2026-04-23 04:25:51 +00:00
19 lines
481 B
TypeScript
19 lines
481 B
TypeScript
import { env } from "@/lib/env";
|
|
|
|
const BASE_URL = env.APP_URL;
|
|
|
|
|
|
export async function GET() {
|
|
const redirect = encodeURIComponent(
|
|
`${BASE_URL}/api/auth/callback`
|
|
);
|
|
|
|
const keycloakUrl =
|
|
`${env.KEYCLOAK_BASE_URL}/realms/${env.KEYCLOAK_REALM}/protocol/openid-connect/auth` +
|
|
`?client_id=${encodeURIComponent(env.KEYCLOAK_CLIENT_ID)}` +
|
|
`&response_type=code` +
|
|
`&scope=openid` +
|
|
`&redirect_uri=${redirect}`;
|
|
|
|
return Response.redirect(keycloakUrl);
|
|
} |