mirror of
https://github.com/PeterMaquiran/tvone.git
synced 2026-04-21 10:25:42 +00:00
18 lines
475 B
TypeScript
18 lines
475 B
TypeScript
export async function GET(req: Request) {
|
|
|
|
const url = new URL(req.url);
|
|
const origin = url.origin;
|
|
|
|
const redirect = encodeURIComponent(
|
|
`${origin}/api/auth/callback`
|
|
);
|
|
|
|
const keycloakUrl =
|
|
`https://keycloak.petermaquiran.xyz/auth/realms/tvone/protocol/openid-connect/auth` +
|
|
`?client_id=tvone-web` +
|
|
`&response_type=code` +
|
|
`&scope=openid` +
|
|
`&redirect_uri=${redirect}`;
|
|
|
|
return Response.redirect(keycloakUrl);
|
|
} |