feat: refactor and refine authentication system with decoupled user management and admin console

This commit is contained in:
2026-05-30 14:05:11 +05:00
parent f35908095c
commit f6ea8a99d9
17 changed files with 816 additions and 191 deletions
+10 -6
View File
@@ -9,8 +9,8 @@
<div class="absolute top-0 left-0 w-full h-1 bg-emerald-500"></div>
<div class="text-center mb-8">
<h2 class="text-3xl font-extrabold text-slate-100 tracking-tight">Create Account</h2>
<p class="mt-2 text-sm text-slate-400">Join us to start planning your tasks</p>
<h2 class="text-3xl font-extrabold text-slate-100 tracking-tight">Register User</h2>
<p class="mt-2 text-sm text-slate-400">Create a new developer or administrator account</p>
</div>
{% if let Some(err) = error %}
@@ -32,18 +32,22 @@
{% endif %}
<form class="space-y-5" action="/auth/register" method="post">
{{ ui::text_input(id="username", name="username", label="Username", type="text", placeholder="Choose a username", required=true) }}
{{ ui::text_input(id="username", name="username", label="Username", type="text", placeholder="Enter username", required=true) }}
{{ ui::text_input(id="password", name="password", label="Password", type="password", placeholder="••••••••", required=true) }}
<div class="flex items-center gap-2 py-1">
<input type="checkbox" id="is_admin" name="is_admin" class="w-4 h-4 rounded border-border bg-[#0f172a] text-indigo-600 focus:ring-sky-500 focus:ring-offset-background">
<label for="is_admin" class="text-xs font-semibold text-slate-400">Make Administrator</label>
</div>
<div>
{{ ui::button(label="Sign Up", variant="primary", type="submit", extra_class="w-full py-3.5 bg-emerald-600 hover:bg-emerald-700 text-white shadow-lg shadow-emerald-500/10 focus:ring-emerald-500") }}
{{ ui::button(label="Register User", variant="indigo", type="submit", extra_class="w-full py-3.5 shadow-lg shadow-indigo-500/10") }}
</div>
</form>
<div class="mt-6 text-center text-sm text-slate-400">
Already have an account?
<a href="/auth/login" class="font-medium text-emerald-400 hover:underline">Log in here</a>
<a href="/auth/users" class="font-medium text-sky-400 hover:underline">← Back to Users</a>
</div>
</div>
</div>