Skip to content

Commit

Permalink
fix(auth): Update sign-in button to use dynamic authentication URL
Browse files Browse the repository at this point in the history
  • Loading branch information
phoenixpereira committed Feb 5, 2025
1 parent 55af71a commit 9c18244
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/Header/components/SignInJoin.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { env } from '@/env.mjs';
import { signIn } from 'next-auth/react';
import Link from 'next/link';
import Button from '../../Button';

export function SignInJoin() {
const redirectUri = `${env.NEXT_PUBLIC_KEYCLOAK_REDIRECT_URI}?registered`;
const authUrl = `${env.NEXT_PUBLIC_AUTH_KEYCLOAK_ISSUER}/protocol/openid-connect/auth?response_type=code&client_id=website&redirect_uri=${redirectUri}&scope=openid+profile+email`;
return (
<>
<Button colour="orange" onClick={() => signIn('keycloak')}>
<Button colour="orange" href={authUrl}>
Sign In
</Button>
<Button colour="purple" href="/join">
Expand Down

0 comments on commit 9c18244

Please sign in to comment.