ソースを参照

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

ebagabee 5 日 前
コミット
108c4db688
1 ファイル変更1 行追加2 行削除
  1. 1 2
      app/Services/AuthService.php

+ 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');
             }
         }