EV3-413 Kilépéskor azonos login oldara írányítás
FIX login route
This commit is contained in:
parent
bd1bade688
commit
71ed81e30c
@ -2,12 +2,17 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Http\RedirectResponse;
|
||||||
use Illuminate\View\View;
|
use Illuminate\View\View;
|
||||||
|
|
||||||
class LegacyLayoutController extends Controller
|
class LegacyLayoutController extends Controller
|
||||||
{
|
{
|
||||||
public function show(string $path = ''): View
|
public function show(string $path = ''): View|RedirectResponse
|
||||||
{
|
{
|
||||||
|
if (! auth()->check()) {
|
||||||
|
return redirect()->route('login');
|
||||||
|
}
|
||||||
|
|
||||||
$targetUrl = $path !== ''
|
$targetUrl = $path !== ''
|
||||||
? url($path)
|
? url($path)
|
||||||
: route('dashboard.index');
|
: route('dashboard.index');
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<h2>Tisztelt Egységvezető, Kedves Munkatársunk!</h2>
|
<h2>Tisztelt Egységvezető, Kedves Munkatársunk!</h2>
|
||||||
<P>Új árlista került feltöltésre a Szállítói webrendelő felületre.</P>
|
<P>Új árlista került feltöltésre a Szállítói webrendelő felületre.</P>
|
||||||
<P>Az újonnan feltöltött dokumentum megnevezése: {{$priceList['fileName']}}. </P>
|
<P>Az újonnan feltöltött dokumentum megnevezése: {{$priceList['fileName']}}. </P>
|
||||||
<P>Letölthető fájl: <a href="{{route('landing')}}" >{{$priceList['fileName']}}</a> </P>
|
<P>Letölthető fájl: <a href="{{route('login')}}" >{{$priceList['fileName']}}</a> </P>
|
||||||
<P>Kérjük, hogy a lehető leghamarabb nézd át a feltöltött árlistát, mivel az Egységed számára fontos információt, megváltozott beszerzési árakat tartalmaz.</P>
|
<P>Kérjük, hogy a lehető leghamarabb nézd át a feltöltött árlistát, mivel az Egységed számára fontos információt, megváltozott beszerzési árakat tartalmaz.</P>
|
||||||
<P>Köszönjük az együttműködésed!</P>
|
<P>Köszönjük az együttműködésed!</P>
|
||||||
<P>Üdvözlettel: Központi Beszerzési osztály</P>
|
<P>Üdvözlettel: Központi Beszerzési osztály</P>
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
@endif
|
@endif
|
||||||
|
|
||||||
<body class="ui-widget-content text-center">
|
<body class="ui-widget-content text-center">
|
||||||
<form class="form-signin" action="{{route('login')}}" method="POST">
|
<form class="form-signin" action="{{route('login.post')}}" method="POST">
|
||||||
@csrf
|
@csrf
|
||||||
@if ($errors->any())
|
@if ($errors->any())
|
||||||
<div class="alert alert-danger">
|
<div class="alert alert-danger">
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
'icon'=>'ico_home',
|
'icon'=>'ico_home',
|
||||||
'link'=>'?m=dashboard',
|
'link'=>'?m=dashboard',
|
||||||
];
|
];
|
||||||
if(auth()->user()->hasRole(['root','developer','admin'])){
|
if(auth()->check() && auth()->user()->hasRole(['root','developer','admin'])){
|
||||||
$priceListRoute=route('admin.priceList.index');
|
$priceListRoute=route('admin.priceList.index');
|
||||||
$supplierRoute=route('admin.supplier.index');
|
$supplierRoute=route('admin.supplier.index');
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
@ -57,7 +57,16 @@
|
|||||||
|
|
||||||
Route::get('/test', [TestController::class, 'test'])->name('test');
|
Route::get('/test', [TestController::class, 'test'])->name('test');
|
||||||
|
|
||||||
Route::post('/login', [LoginController::class, 'authenticate'])->name('login');
|
Route::get('/login', function () {
|
||||||
|
if (! auth()->check()) {
|
||||||
|
return view('layout.login');
|
||||||
|
}
|
||||||
|
|
||||||
|
return redirect()->route('legacy.show');
|
||||||
|
})->name('login');
|
||||||
|
|
||||||
|
Route::post('/login', [LoginController::class, 'authenticate'])->name('login.post');
|
||||||
|
|
||||||
Route::get('/logout', function () {
|
Route::get('/logout', function () {
|
||||||
Auth::logout();
|
Auth::logout();
|
||||||
\request()->session()->invalidate();
|
\request()->session()->invalidate();
|
||||||
@ -69,12 +78,8 @@
|
|||||||
Route::get('/orderFeedback/{feedbackId}', [\App\Http\Controllers\SupplierFeedbackController::class, 'orderFeedback'])->name('orderFeedback');
|
Route::get('/orderFeedback/{feedbackId}', [\App\Http\Controllers\SupplierFeedbackController::class, 'orderFeedback'])->name('orderFeedback');
|
||||||
|
|
||||||
Route::get('/', function () {
|
Route::get('/', function () {
|
||||||
if (! auth()->check()) {
|
return redirect()->route('login');
|
||||||
return view('layout.login');
|
});
|
||||||
}
|
|
||||||
|
|
||||||
return redirect()->route('legacy.show');
|
|
||||||
})->name('landing');
|
|
||||||
|
|
||||||
Route::get('/legacy/{path?}', [LegacyLayoutController::class, 'show'])
|
Route::get('/legacy/{path?}', [LegacyLayoutController::class, 'show'])
|
||||||
->where('path', '.*')
|
->where('path', '.*')
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user