75 lines
4.1 KiB
Twig
75 lines
4.1 KiB
Twig
{% extends 'base.twig' %}
|
|
|
|
{% block body %}
|
|
<div class="min-h-screen flex items-center justify-center bg-gray-50 py-12 px-4 sm:px-6 lg:px-8">
|
|
<div class="max-w-md w-full space-y-8 p-10 bg-white rounded-xl shadow-lg">
|
|
|
|
<img src="{{ asset('provider/images/logo.png') }}"/>
|
|
<h2 class="mt-6 text-center text-3xl font-extrabold text-gray-900">
|
|
{{ 'security.login'|trans }}
|
|
</h2>
|
|
|
|
{# Display error messages if login fails #}
|
|
{% if error %}
|
|
<div class="p-4 mb-4 text-sm text-red-700 bg-red-100 rounded-lg" role="alert">
|
|
{{ error.messageKey|trans(error.messageData, 'security') }}
|
|
</div>
|
|
{% endif %}
|
|
{% for message in app.flashes('success') %}
|
|
<div class="p-4 text-sm text-green-700 bg-green-100 rounded-lg" role="alert">
|
|
{{ message }}
|
|
</div>
|
|
{% endfor %}
|
|
{# The actual login form #}
|
|
<form class="mt-8 space-y-6" action="{{ path('app_home') }}" method="post">
|
|
<input type="hidden" name="remember" value="true">
|
|
|
|
{# Username Field (Email) #}
|
|
<div class="rounded-md shadow-sm -space-y-px">
|
|
<div>
|
|
<label for="username" class="sr-only">{{ 'label.email'|trans }}</label>
|
|
<input id="username" name="_username" type="email" autocomplete="email" required
|
|
class="appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-t-md focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm"
|
|
placeholder="{{ 'label.email'|trans }}" value="{{ last_username }}" autofocus>
|
|
</div>
|
|
|
|
{# Password Field #}
|
|
<div>
|
|
<label for="password" class="sr-only">{{ 'label.password'|trans }}</label>
|
|
<input id="password" name="_password" type="password" autocomplete="current-password" required
|
|
class="appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm"
|
|
placeholder="{{ 'label.password'|trans }}">
|
|
</div>
|
|
</div>
|
|
|
|
{# Remember Me & Forgot Password (Optional) #}
|
|
<div class="flex items-center justify-between">
|
|
<div class="text-sm">
|
|
<a href="{{ path('app_forgot_password') }}" class="font-medium text-indigo-600 hover:text-indigo-500">
|
|
{{ 'link.forgot_password'|trans }}
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
{# CSRF Token (Important for security) #}
|
|
<input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}">
|
|
|
|
{# Submit Button #}
|
|
<div>
|
|
<button type="submit"
|
|
class="group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
|
|
{{ 'button.sign_in'|trans }}
|
|
</button>
|
|
|
|
<a data-turbo="false" href="{{ path('connect_keycloak_start') }}"
|
|
class="mt-2 group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
|
|
{{ 'button.sso'|trans }}
|
|
</a>
|
|
|
|
</div>
|
|
</form>
|
|
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|