Эх сурвалжийг харах

fix(auth): allow franchisor scoped users to log in

ebagabee 5 өдөр өмнө
parent
commit
108c4db688

+ 1 - 2
app/Services/AuthService.php

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