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()->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)

View File

@@ -15,7 +15,12 @@
<div id="add_address_container" class="green-dark d-none mb-3 mt-3">
<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>
</div>

View File

@@ -7,18 +7,23 @@
<meta name="robots" content="noindex, nofollow">
<meta name="csrf-token" content="{{ csrf_token() }}">
<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') }}">
@stack('css')
</head>
<body class="{{ $bodyClass ?? 'login-page'}}">
<div class="row" style="width: 380px;">
<div class="row">
<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>
@yield('content')
<script src="{{ mix('/boilerplate.min.js', '/assets/vendor/boilerplate') }}"></script>
@stack('js')
</body>

View File

@@ -4,24 +4,31 @@
<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']) }}
<div class="input-group-append">
<button class="btn btn-outline-secondary">
<div class="btn btn-outline-secondary">
<i class="fa fa-at"></i>
</button>
</div>
</div>
{!! $errors->first('email','<p class="text-danger"><strong>:message</strong></p>') !!}
</div>
</div>
<div class="form-group has-feedback">
<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">
<button class="btn btn-outline-secondary">
<div class="btn btn-outline-secondary">
<i class="fa fa-lock"></i>
</button>
</div>
</div>
{!! $errors->first('password','<p class="text-danger"><strong>:message</strong></p>') !!}
</div>
{!! $errors->first('password','<p class="text-danger"><strong>:message</strong></p>') !!}
</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="col-12 col-lg-6 mbs">
<button type="submit" class="btn btn-primary btn-block btn-flat">{{ __('Se connecter') }}</button>

View File

@@ -4,27 +4,33 @@
])
@section('content')
@component('boilerplate::auth.loginbox')
<p class="login-box-msg">{{ __('boilerplate::auth.password_reset.intro') }}</p>
{!! Form::open(['route' => 'Shop.password.update', 'method' => 'post', 'autocomplete'=> 'off']) !!}
{!! Form::hidden('token', $token) !!}
<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 class="login-box">
<div class="card">
<div class="card-body login-card-body">
<p class="login-box-msg">{{ __('boilerplate::auth.password_reset.intro') }}</p>
{!! Form::open(['route' => 'Shop.password.update', 'method' => 'post', 'autocomplete'=> 'off']) !!}
{!! Form::hidden('token', $token) !!}
<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 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() !!}
@endcomponent
</div>
</div>
</div>
@endsection

View File

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

View File

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