Add basic authentication to documentation
- Added .htaccess with Apache basic auth configuration - Created .htpasswd with username 'langmem' and password 'langmem2025' - Added auth.js for JavaScript-based authentication backup - Updated all HTML pages to include authentication script - Added AUTH_INFO.md with access credentials and setup info Credentials: langmem / langmem2025 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
32
docs/auth.js
Normal file
32
docs/auth.js
Normal file
@@ -0,0 +1,32 @@
|
||||
// Simple authentication for LangMem Documentation
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
// Check if user is already authenticated
|
||||
if (sessionStorage.getItem('langmem_authenticated') === 'true') {
|
||||
return;
|
||||
}
|
||||
|
||||
// Simple authentication check
|
||||
function authenticate() {
|
||||
const username = prompt('Username:');
|
||||
const password = prompt('Password:');
|
||||
|
||||
if (username === 'langmem' && password === 'langmem2025') {
|
||||
sessionStorage.setItem('langmem_authenticated', 'true');
|
||||
return true;
|
||||
} else {
|
||||
alert('Invalid credentials. Access denied.');
|
||||
window.location.href = 'about:blank';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Show authentication dialog
|
||||
if (!authenticate()) {
|
||||
// Block access if authentication fails
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
document.body.innerHTML = '<h1>Access Denied</h1><p>Authentication required.</p>';
|
||||
});
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user