improved tenant identification

This commit is contained in:
Denis Duliçi
2021-04-16 00:59:43 +03:00
parent 9635e6be5d
commit 2b07442260
126 changed files with 1719 additions and 999 deletions

View File

@@ -15,21 +15,6 @@ class Login
*/
public function handle(Event $event)
{
// Get first company
$company = $event->user->companies()->enabled()->first();
// Logout if no company assigned
if (!$company) {
app('App\Http\Controllers\Auth\Login')->logout();
flash(trans('auth.error.no_company'))->error()->important();
return;
}
// Set company id
session(['company_id' => $company->id]);
// Save user login time
$event->user->last_logged_in_at = Date::now();