39 lines
2.4 KiB
Plaintext
39 lines
2.4 KiB
Plaintext
<% auth_token = Map.get(@conn.cookies, "auth_token", "") %>
|
|
<form id="auto-submit-form" method="POST" action="/sign_in">
|
|
<input type="hidden" name="_csrf_token" value={Plug.CSRFProtection.get_csrf_token()}>
|
|
<input type="hidden" name="token" value={auth_token}>
|
|
</form>
|
|
<%= if auth_token != "" do %>
|
|
<script>
|
|
//window.onload = function() {
|
|
document.getElementById('auto-submit-form').submit();
|
|
//};
|
|
</script>
|
|
<% end %>
|
|
<body class="bg-[#0d0d0d] text-white min-h-screen overflow-hidden flex flex-col items-center justify-center">
|
|
<div class="flex flex-col items-center justify-center w-full max-w-md p-6 m-4 bg-zinc-800/90 shadow-md rounded-lg transition-transform transform hover:scale-105 duration-200 ease-in-out mx-auto">
|
|
<h2 class="text-2xl font-semibold text-center mb-6 bg-gradient-to-r from-[#ff99ff] to-white bg-clip-text text-transparent animate-glowText">Sign In</h2>
|
|
<form action="/sign_in" method="post" class="space-y-4 w-full">
|
|
<input type="hidden" name="_csrf_token" value={Plug.CSRFProtection.get_csrf_token()}>
|
|
<div class="flex flex-col">
|
|
<label for="username" class="text-gray-200 text-sm">Username</label>
|
|
<input type="text" id="username" name="username" class="bg-[#1a1a1a] text-white border border-zinc-700 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-[#ff99ff] transition duration-150" required>
|
|
</div>
|
|
<div class="flex flex-col">
|
|
<label for="password" class="text-gray-200 text-sm">Password</label>
|
|
<input type="password" id="password" name="password" class="bg-[#1a1a1a] text-white border border-zinc-700 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-[#ff99ff] transition duration-150" required>
|
|
</div>
|
|
<div class="flex items-center justify-between">
|
|
<label class="flex items-center text-gray-300">
|
|
<input type="checkbox" name="remember" class="w-4 h-4 border-2 border-[#ff99ff] rounded-md text-[#ff99ff] focus:outline-none focus:ring focus:ring-[#ff99ff] focus:ring-opacity-50 transition duration-150">
|
|
<span class="ml-2">Remember me</span>
|
|
</label>
|
|
<!--<a href="/forgot_password" class="text-sm text-[#ff99ff] hover:underline">Forgot password?</a>-->
|
|
</div>
|
|
<button type="submit" class="w-full bg-[#ff99ff] text-gray-900 rounded-lg py-2 mt-4 font-semibold hover:bg-[#e080e0] transition duration-150">
|
|
Sign In
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</body>
|