|
@@ -2,7 +2,6 @@
|
|
|
|
|
|
|
|
namespace App\Services;
|
|
namespace App\Services;
|
|
|
|
|
|
|
|
-use App\Enums\UserTypeEnum;
|
|
|
|
|
use App\Mail\PasswordResetCodeMail;
|
|
use App\Mail\PasswordResetCodeMail;
|
|
|
use App\Models\User;
|
|
use App\Models\User;
|
|
|
use App\Models\PersonalAccessToken;
|
|
use App\Models\PersonalAccessToken;
|
|
@@ -25,7 +24,7 @@ public function login(string $email, string $password, string $origem): ?array
|
|
|
$user = User::where("email", $email)->first();
|
|
$user = User::where("email", $email)->first();
|
|
|
|
|
|
|
|
if ($origem === 'admin') {
|
|
if ($origem === 'admin') {
|
|
|
- if ($user->user_type !== UserTypeEnum::ADMIN->value) {
|
|
|
|
|
|
|
+ if ($user->access_scope !== 'franchisor') {
|
|
|
throw new Exception('credenciais invalidas para acesso de franqueadora');
|
|
throw new Exception('credenciais invalidas para acesso de franqueadora');
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|