refacto : clarity and selector consistency

This commit is contained in:
BlackSigKill 2026-02-13 17:27:20 +01:00
parent 76017392ae
commit 8f9e201496
2 changed files with 13 additions and 12 deletions

View file

@ -205,7 +205,7 @@
Sign in with Google Sign in with Google
</button> </button>
<div class="divider" style="display:none">or</div> <div id="divider" class="divider" style="display:none">or</div>
<form id="email-form" onsubmit="emailAuth(event)" style="display:none"> <form id="email-form" onsubmit="emailAuth(event)" style="display:none">
<div class="form-group"> <div class="form-group">
@ -277,9 +277,19 @@
const auth = getAuth(fbApp); const auth = getAuth(fbApp);
const provider = new GoogleAuthProvider(); const provider = new GoogleAuthProvider();
function showError(msg) {
const el = document.getElementById('error');
el.textContent = msg;
el.style.display = 'block';
}
function hideError() {
document.getElementById('error').style.display = 'none';
}
const googleBtn = document.getElementById('google-btn'); const googleBtn = document.getElementById('google-btn');
const emailForm = document.getElementById('email-form'); const emailForm = document.getElementById('email-form');
const divider = document.querySelector('.divider'); const divider = document.getElementById('divider');
const providerState = { const providerState = {
google: true, google: true,
password: true, password: true,
@ -307,16 +317,6 @@
renderProviders(); renderProviders();
function showError(msg) {
const el = document.getElementById('error');
el.textContent = msg;
el.style.display = 'block';
}
function hideError() {
document.getElementById('error').style.display = 'none';
}
function setLoading(loading) { function setLoading(loading) {
document.getElementById('google-btn').disabled = loading; document.getElementById('google-btn').disabled = loading;
document.getElementById('email-btn').disabled = loading; document.getElementById('email-btn').disabled = loading;

View file

@ -58,6 +58,7 @@ export default function authGatePlugin() {
authProviderOverrides.google = AUTH_GOOGLE_ENABLED !== 'false'; authProviderOverrides.google = AUTH_GOOGLE_ENABLED !== 'false';
} }
if (AUTH_EMAIL_ENABLED !== undefined) { if (AUTH_EMAIL_ENABLED !== undefined) {
// Firebase calls it "password" provider; env uses "EMAIL" for clarity
authProviderOverrides.password = AUTH_EMAIL_ENABLED !== 'false'; authProviderOverrides.password = AUTH_EMAIL_ENABLED !== 'false';
} }
if (Object.keys(authProviderOverrides).length > 0) { if (Object.keys(authProviderOverrides).length > 0) {