don't load disabled company #369

This commit is contained in:
denisdulici
2018-06-03 19:27:31 +03:00
parent aeef73ec65
commit e288a42da0
4 changed files with 20 additions and 8 deletions

View File

@@ -17,7 +17,7 @@ class Login
public function handle(ILogin $event)
{
// Get first company
$company = $event->user->companies()->first();
$company = $event->user->companies()->enabled()->first();
// Logout if no company assigned
if (!$company) {