improved tenant identification
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user