mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-05 18:52:44 +01:00
Fixes for logining in via web
This commit is contained in:
parent
1c48c51407
commit
c25e2e6a6d
@ -191,7 +191,9 @@ class LoginController extends BaseController
|
||||
|
||||
Auth::login($account->default_company->owner(), true);
|
||||
|
||||
return redirect($this->redirectTo);
|
||||
$cookie = cookie('db', $account->default_company->db);
|
||||
|
||||
return redirect($this->redirectTo)->withCookie($cookie);
|
||||
}
|
||||
|
||||
|
||||
|
@ -56,7 +56,10 @@ class Kernel extends HttpKernel
|
||||
'db' => [
|
||||
\App\Http\Middleware\SetDb::class,
|
||||
],
|
||||
'url-db' => [
|
||||
'web_db' => [
|
||||
\App\Http\Middleware\SetWebDb::class,
|
||||
],
|
||||
'url_db' => [
|
||||
\App\Http\Middleware\UrlSetDb::class,
|
||||
]
|
||||
];
|
||||
|
@ -46,6 +46,7 @@ class SetDb
|
||||
|
||||
|
||||
return response()->json(json_encode($error, JSON_PRETTY_PRINT) ,403);
|
||||
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
|
@ -37,7 +37,7 @@ Route::get('auth/{provider}', 'Auth\LoginController@redirectToProvider');
|
||||
* Authenticated User Routes
|
||||
*/
|
||||
|
||||
Route::group(['middleware' => ['auth:user', 'db']], function () {
|
||||
Route::group(['middleware' => ['auth:user', 'web_db']], function () {
|
||||
|
||||
Route::resource('dashboard', 'DashboardController'); // name = (dashboard. index / create / show / update / destroy / edit
|
||||
|
||||
@ -88,7 +88,7 @@ Route::group(['middleware' => ['auth:user', 'db']], function () {
|
||||
/*
|
||||
* Inbound routes requiring DB Lookup
|
||||
*/
|
||||
Route::group(['middleware' => ['url-db']], function () {
|
||||
Route::group(['middleware' => ['url_db']], function () {
|
||||
|
||||
Route::get('/user/confirm/{confirmation_code}', 'UserController@confirm');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user