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;
|
||||
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\View\View;
|
||||
|
||||
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 !== ''
|
||||
? url($path)
|
||||
: route('dashboard.index');
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<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>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öszönjük az együttműködésed!</P>
|
||||
<P>Üdvözlettel: Központi Beszerzési osztály</P>
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
@endif
|
||||
|
||||
<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
|
||||
@if ($errors->any())
|
||||
<div class="alert alert-danger">
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
'icon'=>'ico_home',
|
||||
'link'=>'?m=dashboard',
|
||||
];
|
||||
if(auth()->user()->hasRole(['root','developer','admin'])){
|
||||
if(auth()->check() && auth()->user()->hasRole(['root','developer','admin'])){
|
||||
$priceListRoute=route('admin.priceList.index');
|
||||
$supplierRoute=route('admin.supplier.index');
|
||||
}else{
|
||||
|
||||
@ -57,7 +57,16 @@
|
||||
|
||||
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 () {
|
||||
Auth::logout();
|
||||
\request()->session()->invalidate();
|
||||
@ -69,12 +78,8 @@
|
||||
Route::get('/orderFeedback/{feedbackId}', [\App\Http\Controllers\SupplierFeedbackController::class, 'orderFeedback'])->name('orderFeedback');
|
||||
|
||||
Route::get('/', function () {
|
||||
if (! auth()->check()) {
|
||||
return view('layout.login');
|
||||
}
|
||||
|
||||
return redirect()->route('legacy.show');
|
||||
})->name('landing');
|
||||
return redirect()->route('login');
|
||||
});
|
||||
|
||||
Route::get('/legacy/{path?}', [LegacyLayoutController::class, 'show'])
|
||||
->where('path', '.*')
|
||||
|
||||
Loading…
Reference in New Issue
Block a user