hm_ai_qc_report_tool/static/js/auth.js
nickviljoen f21e41afc3 v1.2.0: Add Docker deployment, simplify auth to local login, production config
- Add Dockerfile, docker-compose.yml, .dockerignore for containerised deployment
- Add deploy/ scripts (deploy.sh, nginx/apache configs, password generator)
- Replace MSAL/Azure AD auth with local username/password authentication
- Add login.html template
- Simplify app.py, middleware, and auth routes for production use
- Update gunicorn_config.py and wsgi.py for Docker/production
- Update templates to work with new auth and URL prefix handling

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 14:37:53 +02:00

20 lines
615 B
JavaScript

/**
* Minimal auth handler — logout button only.
* Server-side session auth handles all gating via redirects.
*/
(function() {
const logoutBtn = document.getElementById('logoutBtn');
if (logoutBtn) {
logoutBtn.addEventListener('click', async () => {
try {
await fetch(window.BASE_URL + '/auth/logout', {
method: 'POST',
credentials: 'include'
});
} catch (e) {
// ignore
}
window.location.href = window.BASE_URL + '/auth/login-page';
});
}
})();