Fix missing alert message on front + add message must be logged in

This commit is contained in:
Jérémy Munsch 2022-06-30 15:21:11 +02:00
parent a94bbdd7ff
commit 03e9643be1
No known key found for this signature in database
GPG key ID: 18361AF3BFEC0FEC
9 changed files with 24 additions and 8 deletions

View file

@ -3,6 +3,7 @@
namespace App\Http\Middleware; namespace App\Http\Middleware;
use Illuminate\Auth\Middleware\Authenticate as Middleware; use Illuminate\Auth\Middleware\Authenticate as Middleware;
use Illuminate\Support\Facades\Session;
class Authenticate extends Middleware class Authenticate extends Middleware
{ {
@ -19,6 +20,7 @@ class Authenticate extends Middleware
'employee' => route('employees.login') 'employee' => route('employees.login')
]; ];
if (! $request->expectsJson()) { if (! $request->expectsJson()) {
Session::flash('message', trans('Vous devez vous identifier pour àccéder à cette page'));
foreach ($request->route()->gatherMiddleware() as $middleware) { foreach ($request->route()->gatherMiddleware() as $middleware) {
if (\is_string($middleware) and strpos($middleware, 'auth:') !== false) { if (\is_string($middleware) and strpos($middleware, 'auth:') !== false) {
$route = $logins[str_replace('auth:', '', $middleware)] ?? null; $route = $logins[str_replace('auth:', '', $middleware)] ?? null;

View file

@ -9,4 +9,16 @@
#siteid { #siteid {
color: white; color: white;
margin-right: 100px; margin-right: 100px;
} }
.alertMessage {
text-align: center;
max-width: 80%;
min-width: 15rem;
margin: 1rem auto;
padding: 0.5rem 1rem;
background-color: #e5e2e2;
font-weight: bold;
border-radius: 0.4rem;
font-family: Tahoma;
}

View file

@ -1,4 +1,4 @@
@import "_import"; @import "./_import";
@import "layouts/backend/top_nav"; @import "layouts/backend/top_nav";

View file

@ -1,2 +1,3 @@
@import "~swiper/swiper.min"; @import "~swiper/swiper.min";
@import "front/style.sass"; @import "front/style.sass";
@import "./_import";

View file

@ -1,2 +1,3 @@
@import "~swiper/swiper.min"; @import "~swiper/swiper.min";
@import "front/styleLogin.sass"; @import "front/styleLogin.sass";
@import "./_import";

View file

@ -29,4 +29,4 @@
<!-- STYLES --> <!-- STYLES -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css" integrity="sha256-hHKA3d/HttC8OW3Sl093W8DoZudhHJDj++kZYo6MLzA=" crossorigin="anonymous"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css" integrity="sha256-hHKA3d/HttC8OW3Sl093W8DoZudhHJDj++kZYo6MLzA=" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@11.0.16/dist/sweetalert2.min.css" integrity="sha256-qpXwccFYncH5gTqXFe9EXZ8QeDw1Re68bbNVfFZzIzg=" crossorigin="anonymous"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@11.0.16/dist/sweetalert2.min.css" integrity="sha256-qpXwccFYncH5gTqXFe9EXZ8QeDw1Re68bbNVfFZzIzg=" crossorigin="anonymous">
<link rel="stylesheet" href="{{ asset('css/preload-back.css') }}"> <link rel="stylesheet" href="{{ mix('css/preload-back.css') }}">

View file

@ -7,7 +7,7 @@
</head> </head>
<body> <body>
@include("layouts.frontend.header") @include("layouts.frontend.header")
<!--@include('layouts.frontend.message')--> @include('layouts.frontend.message')
@yield('content') @yield('content')
@include("layouts.frontend.footer") @include("layouts.frontend.footer")
@stack('scriptsConstants') @stack('scriptsConstants')

View file

@ -24,8 +24,8 @@
@preload('mix-manifest.json') @preload('mix-manifest.json')
<!-- STYLES --> <!-- STYLES -->
<link rel="stylesheet" href="{{ asset('css/preload-front_login.css') }}"> <link rel="stylesheet" href="{{ mix('css/preload-front_login.css') }}">
<link rel="stylesheet" href="{{ asset('css/preload-front.css') }}"> <link rel="stylesheet" href="{{ mix('css/preload-front.css') }}">
<style> <style>
:root { :root {
@if(isset($societe->colors['primary'])) @if(isset($societe->colors['primary']))
@ -53,4 +53,4 @@
} }
gtag('js', new Date()); gtag('js', new Date());
gtag('config', 'G-PTNNFW0ZE1'); gtag('config', 'G-PTNNFW0ZE1');
</script> </script>

View file

@ -1,5 +1,5 @@
@if(session('message')) @if(session('message'))
<div> <div class="alertMessage">
{{ session('message') }} {{ session('message') }}
</div> </div>
@endif @endif