Achivements abends um 19 uhr

This commit is contained in:
2025-09-07 16:54:09 +02:00
parent 8342d95a13
commit 5bed125cf6
10 changed files with 1136 additions and 347 deletions

View File

@@ -39,6 +39,32 @@ async function signInWithGoogle() {
}
}
// Discord OAuth Sign In
async function signInWithDiscord() {
try {
setLoading(true);
clearMessage();
const { data, error } = await supabase.auth.signInWithOAuth({
provider: 'discord',
options: {
redirectTo: `${window.location.origin}/auth/callback`
}
});
if (error) {
console.error('Discord OAuth error:', error);
showMessage('Fehler bei der Discord-Anmeldung: ' + error.message, 'error');
}
// Note: OAuth redirects the page, so we don't need to handle success here
} catch (error) {
console.error('Discord OAuth error:', error);
showMessage('Fehler bei der Discord-Anmeldung: ' + error.message, 'error');
} finally {
setLoading(false);
}
}
// Toggle between login and register forms
function toggleForm() {
const loginForm = document.getElementById('loginForm');
@@ -94,6 +120,9 @@ function setupEventListeners() {
// Handle Google OAuth
document.getElementById('googleSignInBtn').addEventListener('click', signInWithGoogle);
// Handle Discord OAuth
document.getElementById('discordSignInBtn').addEventListener('click', signInWithDiscord);
// Cookie settings button
const cookieSettingsBtn = document.getElementById('cookie-settings-footer');
if (cookieSettingsBtn) {