mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge pull request #7507 from CirkaN/Cirkovic/INA-7
INA-7 | Add Vendor guard
This commit is contained in:
commit
7658c66953
@ -39,6 +39,12 @@ class RedirectIfAuthenticated
|
||||
// return redirect()->route('dashboard.index');
|
||||
// }
|
||||
break;
|
||||
case 'vendor':
|
||||
if (Auth::guard($guard)->check()) {
|
||||
//TODO create routes for vendor
|
||||
// return redirect()->route('vendor.dashboard');
|
||||
}
|
||||
break;
|
||||
default:
|
||||
Auth::logout();
|
||||
// if (Auth::guard($guard)->check()) {
|
||||
|
@ -121,4 +121,12 @@ class RouteServiceProvider extends ServiceProvider
|
||||
->namespace($this->namespace)
|
||||
->group(base_path('routes/shop.php'));
|
||||
}
|
||||
|
||||
protected function mapVendorsApiRoutes()
|
||||
{
|
||||
Route::prefix('')
|
||||
->middleware('vendor')
|
||||
->namespace($this->namespace)
|
||||
->group(base_path('routes/vendor.php'));
|
||||
}
|
||||
}
|
||||
|
@ -56,6 +56,10 @@ return [
|
||||
'driver' => 'session',
|
||||
'provider' => 'contacts',
|
||||
],
|
||||
'vendor' => [
|
||||
'driver' => 'session',
|
||||
'provider' => 'vendors',
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
@ -85,6 +89,11 @@ return [
|
||||
'driver' => 'eloquent',
|
||||
'model' => App\Models\ClientContact::class,
|
||||
],
|
||||
'vendors' => [
|
||||
'driver' => 'eloquent',
|
||||
'model' => App\Models\VendorContact::class,
|
||||
],
|
||||
|
||||
|
||||
// 'users' => [
|
||||
// 'driver' => 'database',
|
||||
@ -120,6 +129,11 @@ return [
|
||||
'table' => 'password_resets',
|
||||
'expire' => 60,
|
||||
],
|
||||
'vendors' => [
|
||||
'provider' => 'vendors',
|
||||
'table' => 'password_resets',
|
||||
'expire' => 60,
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|
15
routes/vendor.php
Normal file
15
routes/vendor.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| API Routes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here is where you can register API routes for your application. These
|
||||
| routes are loaded by the RouteServiceProvider within a group which
|
||||
| is assigned the "api" middleware group. Enjoy building your API!
|
||||
|
|
||||
*/
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user