mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-02 17:25:05 +02:00
Added user entity and basic login/logout system.
This commit is contained in:
parent
71711bc0ba
commit
62d875d1e5
8 changed files with 925 additions and 191 deletions
51
templates/security/login.html.twig
Normal file
51
templates/security/login.html.twig
Normal file
|
@ -0,0 +1,51 @@
|
|||
{% extends "main_card.html.twig" %}
|
||||
|
||||
{% block title %}{% trans %}login.title{% endtrans %}{% endblock %}
|
||||
|
||||
{% block card_title %}<h5>
|
||||
<i class="fa fa-sign-in-alt fa-fw" aria-hidden="true"></i>
|
||||
{% trans %}login.card_title{% endtrans %}
|
||||
</h5>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% if error %}
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<strong>{{ error.messageKey|trans(error.messageData, 'security') }}</strong>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{{ parent() }}
|
||||
{% endblock %}
|
||||
|
||||
{% block card_content %}
|
||||
<form action="{{ path('login') }}" method="post" class="form-hor">
|
||||
|
||||
<input type="hidden" name="_csrf_token"
|
||||
value="{{ csrf_token('authenticate') }}">
|
||||
|
||||
<input type="hidden" name="_target_path" value="{{ app.request.query.get('_target_path') }}" />
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-3 col-lg-2">{% trans %}login.username.label{% endtrans %}</label>
|
||||
<div class="col-md-9 col-lg-10">
|
||||
<input type="text" class="form-control" name="_username" value="{{ last_username }}"
|
||||
placeholder="{% trans %}login.username.placeholder{% endtrans %}" autocomplete="username">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-3 col-lg-2">{% trans %}login.password.label{% endtrans %}</label>
|
||||
<div class="col-md-9 col-lg-10">
|
||||
<input type="password" class="form-control" placeholder="{% trans %}login.password.placeholder{% endtrans %}" name="_password"
|
||||
autocomplete="current-password">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<div class="col-md-9 offset-md-3 col-lg-10 offset-lg-2">
|
||||
<button type="submit" class="btn btn-primary">{% trans %}login.btn{% endtrans %}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
Loading…
Add table
Add a link
Reference in a new issue