Skip to content

Commit

Permalink
fix(website): fixes login button
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas Zarzalis (TNG) authored and JonasKellerer committed Dec 11, 2024
1 parent cb94ee2 commit 64dcd79
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions website/src/components/auth/LoginButton.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { signIn } from 'auth-astro/client';

export function LoginButton() {
const login = async () => {
const login = () => {
const callbackUrlThatDoesNotImmediatelyLogoutAgain = new URL(window.location.href).pathname.endsWith('/logout')
? new URL('/', window.location.href).toString()
: undefined;
await signIn('github', { callbackUrl: callbackUrlThatDoesNotImmediatelyLogoutAgain });
signIn('github', { callbackUrl: callbackUrlThatDoesNotImmediatelyLogoutAgain }).catch(() => {});
};

return <button onClick={void login}>Login</button>;
return <button onClick={login}>Login</button>;
}

0 comments on commit 64dcd79

Please sign in to comment.