fixes on login

This commit is contained in:
Ludovic CANDELLIER
2023-08-28 22:58:11 +02:00
parent f721422abc
commit 7addea00a2
7 changed files with 94 additions and 73 deletions

View File

@@ -41,7 +41,7 @@ class LoginController extends Controller
return (back()->getTargetUrl() == route('Shop.login')) ? redirect()->intended(route('home')) : back(); return (back()->getTargetUrl() == route('Shop.login')) ? redirect()->intended(route('home')) : back();
} }
return back()->withInput($request->only('email', 'remember')); return back()->withErrors(['msg' => 'Identifiant ou mot de passe incorrect'])->withInput($request->only('email', 'remember'));
} }
public function logout(Request $request) public function logout(Request $request)

View File

@@ -15,7 +15,12 @@
<div id="add_address_container" class="green-dark d-none mb-3 mt-3"> <div id="add_address_container" class="green-dark d-none mb-3 mt-3">
<x-card classBody="bg-green-dark yellow" title="Nouvelle adresse"> <x-card classBody="bg-green-dark yellow" title="Nouvelle adresse">
@include('components.address', ['prefix' => 'deliveries', 'with_country' => false, 'with_tab' => true]) @include('Shop.Customers.partials.address', [
'prefix' => 'deliveries',
'with_country' => false,
'with_tab' => true,
'label' => 'Adresse',
])
</x-card> </x-card>
</div> </div>

View File

@@ -7,18 +7,23 @@
<meta name="robots" content="noindex, nofollow"> <meta name="robots" content="noindex, nofollow">
<meta name="csrf-token" content="{{ csrf_token() }}"> <meta name="csrf-token" content="{{ csrf_token() }}">
<title>{{ $title }} | {{ config('app.name') }}</title> <title>{{ $title }} | {{ config('app.name') }}</title>
<link rel="stylesheet" href="/assets/css/main.min.css?{{ time() }}">
<link rel="stylesheet" href="{{ mix('/plugins/fontawesome/fontawesome.min.css', '/assets/vendor/boilerplate') }}">
<link rel="stylesheet" href="{{ mix('/adminlte.min.css', '/assets/vendor/boilerplate') }}"> <link rel="stylesheet" href="{{ mix('/adminlte.min.css', '/assets/vendor/boilerplate') }}">
@stack('css') @stack('css')
</head> </head>
<body class="{{ $bodyClass ?? 'login-page'}}"> <body class="{{ $bodyClass ?? 'login-page'}}">
<div class="row" style="width: 380px;"> <div class="row">
<div class="col-12 text-center"> <div class="col-12 text-center">
<img src="/img/logo.png" height="128"> <img src="/img/logo.png" class="img-fluid">
</div>
</div>
<div class="row">
<div class="col-12 text-center">
@yield('content')
</div> </div>
</div> </div>
@yield('content')
<script src="{{ mix('/boilerplate.min.js', '/assets/vendor/boilerplate') }}"></script> <script src="{{ mix('/boilerplate.min.js', '/assets/vendor/boilerplate') }}"></script>
@stack('js') @stack('js')
</body> </body>

View File

@@ -4,24 +4,31 @@
<div class="input-group form-group {{ $errors->has('email') ? 'has-error' : '' }}"> <div class="input-group form-group {{ $errors->has('email') ? 'has-error' : '' }}">
{{ Form::email('email', old('email'), ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.email'), 'required', 'autofocus']) }} {{ Form::email('email', old('email'), ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.email'), 'required', 'autofocus']) }}
<div class="input-group-append"> <div class="input-group-append">
<button class="btn btn-outline-secondary"> <div class="btn btn-outline-secondary">
<i class="fa fa-at"></i> <i class="fa fa-at"></i>
</button> </div>
</div> </div>
{!! $errors->first('email','<p class="text-danger"><strong>:message</strong></p>') !!} {!! $errors->first('email','<p class="text-danger"><strong>:message</strong></p>') !!}
</div> </div>
</div> </div>
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<div class="input-group form-group {{ $errors->has('password') ? 'has-error' : '' }}"> <div class="input-group form-group {{ $errors->has('password') ? 'has-error' : '' }}">
{{ Form::password('password', ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.password')]) }} {{ Form::password('password', ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.password'), 'required']) }}
<div class="input-group-append"> <div class="input-group-append">
<button class="btn btn-outline-secondary"> <div class="btn btn-outline-secondary">
<i class="fa fa-lock"></i> <i class="fa fa-lock"></i>
</button> </div>
</div> </div>
{!! $errors->first('password','<p class="text-danger"><strong>:message</strong></p>') !!}
</div> </div>
{!! $errors->first('password','<p class="text-danger"><strong>:message</strong></p>') !!}
</div> </div>
@if ($errors->any())
<div class="form-group has-feedback">
<p class="text-danger">
<strong>{{ $errors->first('msg') }}</strong>
</p>
</div>
@endif
<div class="row"> <div class="row">
<div class="col-12 col-lg-6 mbs"> <div class="col-12 col-lg-6 mbs">
<button type="submit" class="btn btn-primary btn-block btn-flat">{{ __('Se connecter') }}</button> <button type="submit" class="btn btn-primary btn-block btn-flat">{{ __('Se connecter') }}</button>

View File

@@ -4,27 +4,33 @@
]) ])
@section('content') @section('content')
@component('boilerplate::auth.loginbox') <div class="login-box">
<p class="login-box-msg">{{ __('boilerplate::auth.password_reset.intro') }}</p> <div class="card">
{!! Form::open(['route' => 'Shop.password.update', 'method' => 'post', 'autocomplete'=> 'off']) !!} <div class="card-body login-card-body">
{!! Form::hidden('token', $token) !!} <p class="login-box-msg">{{ __('boilerplate::auth.password_reset.intro') }}</p>
<div class="form-group {{ $errors->has('email') ? 'has-error' : '' }}"> {!! Form::open(['route' => 'Shop.password.update', 'method' => 'post', 'autocomplete'=> 'off']) !!}
{{ Form::email('email', old('email', $email), ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.email'), 'required', 'autofocus']) }} {!! Form::hidden('token', $token) !!}
{!! $errors->first('email','<p class="text-danger"><strong>:message</strong></p>') !!} <div class="form-group {{ $errors->has('email') ? 'has-error' : '' }}">
{{ Form::email('email', old('email', $email), ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.email'), 'required', 'autofocus']) }}
{!! $errors->first('email','<p class="text-danger"><strong>:message</strong></p>') !!}
</div>
<div class="form-group {{ $errors->has('password') ? 'has-error' : '' }}">
{{ Form::password('password', ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.password'), 'required']) }}
{!! $errors->first('password','<p class="text-danger"><strong>:message</strong></p>') !!}
</div>
<div class="form-group {{ $errors->has('password_confirmation') ? 'has-error' : '' }}">
{{ Form::password('password_confirmation', ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.password_confirm'), 'required']) }}
{!! $errors->first('password_confirmation','<p class="text-danger"><strong>:message</strong></p>') !!}
</div>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 text-center">
<button class="btn btn-primary" type="submit">{{ __('boilerplate::auth.password_reset.submit') }}</button>
</div>
</div>
{!! Form::close() !!}
</div> </div>
<div class="form-group {{ $errors->has('password') ? 'has-error' : '' }}"> </div>
{{ Form::password('password', ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.password'), 'required']) }} </div>
{!! $errors->first('password','<p class="text-danger"><strong>:message</strong></p>') !!} </div>
</div>
<div class="form-group {{ $errors->has('password_confirmation') ? 'has-error' : '' }}">
{{ Form::password('password_confirmation', ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.password_confirm'), 'required']) }}
{!! $errors->first('password_confirmation','<p class="text-danger"><strong>:message</strong></p>') !!}
</div>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 text-center">
<button class="btn btn-primary" type="submit">{{ __('boilerplate::auth.password_reset.submit') }}</button>
</div>
</div>
{!! Form::close() !!}
@endcomponent
@endsection @endsection

View File

@@ -1,44 +1,43 @@
<button type="button" class="btn bg-light green-dark p-0" data-toggle="dropdown"> <button type="button" class="btn bg-light green-dark p-0" data-toggle="dropdown">
@if (App\Repositories\Shop\Customers::isConnected()) @if (App\Repositories\Shop\Customers::isConnected())
<img src="{{ App\Repositories\Shop\Customers::getAvatar() }}" class="img-fluid" title="{{ App\Repositories\Shop\Customers::getName() }}"> <img src="{{ App\Repositories\Shop\Customers::getAvatar() }}" class="img-fluid" title="{{ App\Repositories\Shop\Customers::getName() }}">
@else @else
<img src="/img/header/login.svg" width="36px"> <img src="/img/header/login.svg" width="36px">
@endif @endif
</button> </button>
<ul class="dropdown-menu" aria-labelledby="dLabel"> <ul class="dropdown-menu" aria-labelledby="dLabel">
@if (App\Repositories\Shop\Customers::isConnected()) @if (App\Repositories\Shop\Customers::isConnected())
<li class="dropdown-item"> <li class="dropdown-item">
<a href="{{ route('Shop.Customers.profile') }}" title="Accèdez à vos factures, remises ..." rel="nofollow"> <a href="{{ route('Shop.Customers.profile') }}" title="Accèdez à vos factures, remises ..." rel="nofollow">
<span>Votre compte</span> <span>Votre compte</span>
</a> </a>
</li> </li>
<li class="dropdown-item"> <li class="dropdown-item">
<a href="#" onclick="event.preventDefault(); document.getElementById('logout-form').submit();"> <a href="#" onclick="event.preventDefault(); document.getElementById('logout-form').submit();">
Déconnexion Déconnexion
</a> </a>
<form id="logout-form" action="{{ route('Shop.logout') }}" method="POST" style="display: none;"> <form id="logout-form" action="{{ route('Shop.logout') }}" method="POST" style="display: none;">
@csrf @csrf
</form> </form>
</li> </li>
@else @else
<li class="dropdown-item"> <li class="dropdown-item">
<a href="{{ route('Shop.Orders.order') }}" title="Identifiez-vous" rel="nofollow"> <a href="{{ route('Shop.login') }}" title="Identifiez-vous" rel="nofollow">
<span>Connexion</span> <span>Connexion</span>
</a> </a>
</li> </li>
<li class="dropdown-item"> <li class="dropdown-item">
<a href="{{ route('Shop.register') }}" title="Enregistrez-vous" rel="nofollow"> <a href="{{ route('Shop.register') }}" title="Enregistrez-vous" rel="nofollow">
<span>Creer votre compte</span> <span>Creer votre compte</span>
</a> </a>
</li> </li>
<li class="dropdown-item"> @endif
<a href="https://www.jardinenvie.com/boutique/commander" title="Télécharger le catalogue" rel="nofollow"> <li class="dropdown-item">
<span>Télécharger le catalogue</span> <a href="https://www.jardinenvie.com/boutique/commander" title="Télécharger le catalogue" rel="nofollow">
</a> <span>Télécharger le catalogue</span>
</li> </a>
</li>
@endif
</ul> </ul>

View File

@@ -13,8 +13,7 @@
// Auth::routes(); // Auth::routes();
Route::get('', 'Shop\HomeController@index')->name('welcome'); Route::get('', 'Shop\HomeController@index')->name('home');
Route::get('home', 'Shop\HomeController@index')->name('home');
include __DIR__.'/Admin/route.php'; include __DIR__.'/Admin/route.php';
include __DIR__.'/Shop/route.php'; include __DIR__.'/Shop/route.php';