mirror of
https://github.com/MarijnDoeve/TijdVoorDeTest.git
synced 2026-07-05 15:10:16 +02:00
Fix Remember me (#111)
This commit is contained in:
@@ -24,6 +24,9 @@ security:
|
|||||||
default_target_path: tvdt_backoffice_index
|
default_target_path: tvdt_backoffice_index
|
||||||
logout:
|
logout:
|
||||||
path: tvdt_login_logout
|
path: tvdt_login_logout
|
||||||
|
remember_me:
|
||||||
|
secret: '%kernel.secret%'
|
||||||
|
lifetime: 604800 # 1 week in seconds
|
||||||
|
|
||||||
access_control:
|
access_control:
|
||||||
- { path: ^/admin, roles: ROLE_ADMIN }
|
- { path: ^/admin, roles: ROLE_ADMIN }
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ use Symfony\Component\HttpFoundation\Response;
|
|||||||
use Symfony\Component\HttpKernel\Attribute\AsController;
|
use Symfony\Component\HttpKernel\Attribute\AsController;
|
||||||
use Symfony\Component\Routing\Attribute\Route;
|
use Symfony\Component\Routing\Attribute\Route;
|
||||||
use Symfony\Component\Security\Core\Exception\AuthenticationException;
|
use Symfony\Component\Security\Core\Exception\AuthenticationException;
|
||||||
use Symfony\Component\Security\Core\User\UserInterface;
|
|
||||||
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
|
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
use Tvdt\Enum\FlashType;
|
use Tvdt\Enum\FlashType;
|
||||||
|
|||||||
@@ -3,11 +3,6 @@
|
|||||||
{% block title %}Log in{% endblock %}
|
{% block title %}Log in{% endblock %}
|
||||||
|
|
||||||
{% block body %}
|
{% block body %}
|
||||||
{% if app.user %}
|
|
||||||
<div class="mb-3">
|
|
||||||
You are logged in as {{ app.user.userIdentifier }}, <a href="{{ path('tvdt_login_logout') }}">Logout</a>
|
|
||||||
</div>
|
|
||||||
{% else %}
|
|
||||||
<form method="post">
|
<form method="post">
|
||||||
<h1 class="py-2 h3 mb-3 font-weight-normal">{{ 'Please sign in'|trans }}</h1>
|
<h1 class="py-2 h3 mb-3 font-weight-normal">{{ 'Please sign in'|trans }}</h1>
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
@@ -27,7 +22,7 @@
|
|||||||
value="{{ csrf_token('authenticate') }}">
|
value="{{ csrf_token('authenticate') }}">
|
||||||
|
|
||||||
<div class="mb-3 form-check">
|
<div class="mb-3 form-check">
|
||||||
<input type="checkbox" name="_remember_me" id="_remember_me" class="form-check-input">
|
<input type="checkbox" name="_remember_me" id="_remember_me" class="form-check-input" checked>
|
||||||
<label for="_remember_me" class="form-check-label">{{ 'Remember me'|trans }}</label>
|
<label for="_remember_me" class="form-check-label">{{ 'Remember me'|trans }}</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -37,5 +32,4 @@
|
|||||||
<a href="{{ path('tvdt_register') }}"
|
<a href="{{ path('tvdt_register') }}"
|
||||||
class="btn btn-link">{{ 'Create an account'|trans }}</a>
|
class="btn btn-link">{{ 'Create an account'|trans }}</a>
|
||||||
</form>
|
</form>
|
||||||
{% endif %}
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Reference in New Issue
Block a user