Files
LuHost/views/auth/login.ejs
Nathan Schneider 3aed09b60f Initial commit: LuHost - Luanti Server Management Web Interface
A modern web interface for Luanti (Minetest) server management with ContentDB integration.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-23 17:32:37 -06:00

63 lines
2.4 KiB
Plaintext

<%
const body = `
<div style="max-width: 400px; margin: 2rem auto;">
<div class="card">
<div class="card-header" style="text-align: center;">
<h2>Login to Luanti Server Manager</h2>
<p style="color: var(--text-secondary); margin: 0;">Enter your credentials to access the server management interface</p>
</div>
${typeof error !== 'undefined' ? `
<div class="alert alert-danger">
<strong>Error:</strong> ${typeof escapeHtml !== 'undefined' ? escapeHtml(error) : error}
</div>
` : ''}
${typeof req !== 'undefined' && req.query.message ? `
<div class="alert alert-info">
${req.query.message}
</div>
` : ''}
<form method="POST" action="/login">
<input type="hidden" name="redirect" value="${redirectUrl || '/'}">
${typeof csrfToken !== 'undefined' && csrfToken ? `<input type="hidden" name="_csrf" value="${csrfToken}">` : ''}
<div class="form-group">
<label for="username">Username</label>
<input type="text"
id="username"
name="username"
class="form-control"
value="${typeof formData !== 'undefined' ? formData.username || '' : ''}"
required
autofocus
autocomplete="username">
</div>
<div class="form-group">
<label for="password">Password</label>
<input type="password"
id="password"
name="password"
class="form-control"
required
autocomplete="current-password">
</div>
<div style="display: flex; justify-content: flex-end; align-items: center; margin-top: 2rem;">
<button type="submit" class="btn btn-primary">
Sign In
</button>
</div>
</form>
</div>
<div style="text-align: center; margin-top: 1rem; color: var(--text-secondary); font-size: 0.875rem;">
<p>Need an account? Contact an existing administrator to create one for you.</p>
</div>
</div>
`;
%>
<%- include('../layout', { body: body, currentPage: 'login', title: title }) %>