QOL improvements
All checks were successful
Build Images and Deploy / Update-PROD-Stack (push) Successful in 28s
All checks were successful
Build Images and Deploy / Update-PROD-Stack (push) Successful in 28s
This commit is contained in:
@@ -24,6 +24,34 @@
|
||||
</a>
|
||||
<% }) %>
|
||||
<% } %>
|
||||
|
||||
<h2 style="margin-top: 2rem; margin-bottom: 1rem;">Password Reset</h2>
|
||||
<div class="card">
|
||||
<p style="color: var(--muted); font-size: 0.9rem; margin-bottom: 1rem;">Generate a one-time password reset link for a user. The link expires in 24 hours.</p>
|
||||
<form method="POST" action="/admin/reset-password" style="display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: flex-end;">
|
||||
<div class="form-group" style="margin-bottom: 0; flex: 1; min-width: 180px;">
|
||||
<label>Username</label>
|
||||
<select name="username" class="form-control" required>
|
||||
<option value="">Select user...</option>
|
||||
<% if (typeof users !== 'undefined' && users) { users.forEach(u => { %>
|
||||
<option value="<%= u.username %>"><%= u.username %><%= u.is_admin ? ' (admin)' : '' %></option>
|
||||
<% }); } %>
|
||||
</select>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Generate Reset Link</button>
|
||||
</form>
|
||||
|
||||
<% if (typeof resetUrl !== 'undefined' && resetUrl) { %>
|
||||
<div style="margin-top: 1rem; padding: 1rem; background: var(--body-bg); border-radius: 8px;">
|
||||
<p style="margin: 0 0 0.5rem; font-weight: 600;">Reset link for <strong><%= resetUsername %></strong>:</p>
|
||||
<div style="display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap;">
|
||||
<input type="text" class="form-control" value="<%= resetUrl %>" id="reset-url" readonly style="font-family: monospace; font-size: 0.85rem; flex: 1; min-width: 200px;">
|
||||
<button class="btn btn-sm btn-outline" onclick="document.getElementById('reset-url').select();navigator.clipboard.writeText(document.getElementById('reset-url').value).then(()=>{this.textContent='Copied!';setTimeout(()=>this.textContent='Copy',1500)})">Copy</button>
|
||||
</div>
|
||||
<p style="font-size: 0.8rem; color: var(--muted); margin: 0.5rem 0 0;">Send this link to the user. It expires in 24 hours and can only be used once.</p>
|
||||
</div>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%- include('../partials/footer') %>
|
||||
|
||||
Reference in New Issue
Block a user