fixes on login

This commit is contained in:
Ludovic CANDELLIER
2023-08-28 22:58:11 +02:00
parent f85df32c67
commit 043b7d7215
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> </div>
<div class="row">
<div class="col-12 text-center">
@yield('content') @yield('content')
</div>
</div>
<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> </div>
{!! $errors->first('password','<p class="text-danger"><strong>:message</strong></p>') !!} {!! $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> </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,7 +4,9 @@
]) ])
@section('content') @section('content')
@component('boilerplate::auth.loginbox') <div class="login-box">
<div class="card">
<div class="card-body login-card-body">
<p class="login-box-msg">{{ __('boilerplate::auth.password_reset.intro') }}</p> <p class="login-box-msg">{{ __('boilerplate::auth.password_reset.intro') }}</p>
{!! Form::open(['route' => 'Shop.password.update', 'method' => 'post', 'autocomplete'=> 'off']) !!} {!! Form::open(['route' => 'Shop.password.update', 'method' => 'post', 'autocomplete'=> 'off']) !!}
{!! Form::hidden('token', $token) !!} {!! Form::hidden('token', $token) !!}
@@ -26,5 +28,9 @@
</div> </div>
</div> </div>
{!! Form::close() !!} {!! Form::close() !!}
@endcomponent </div>
</div>
</div>
</div>
@endsection @endsection

View File

@@ -25,7 +25,7 @@
</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>
@@ -34,11 +34,10 @@
<span>Creer votre compte</span> <span>Creer votre compte</span>
</a> </a>
</li> </li>
@endif
<li class="dropdown-item"> <li class="dropdown-item">
<a href="https://www.jardinenvie.com/boutique/commander" title="Télécharger le catalogue" rel="nofollow"> <a href="https://www.jardinenvie.com/boutique/commander" title="Télécharger le catalogue" rel="nofollow">
<span>Télécharger le catalogue</span> <span>Télécharger le catalogue</span>
</a> </a>
</li> </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';