Explorar o código

Update ApiV1Dot1Controller, allow upto 5 similar push tokens

Daniel Supernault hai 9 meses
pai
achega
7820b506d8
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      app/Http/Controllers/Api/ApiV1Dot1Controller.php

+ 1 - 1
app/Http/Controllers/Api/ApiV1Dot1Controller.php

@@ -1139,7 +1139,7 @@ class ApiV1Dot1Controller extends Controller
         $expoToken = $request->input('token');
         $expoToken = $request->input('token');
 
 
         $existing = User::where('profile_id', '!=', $pid)->whereExpoToken($expoToken)->count();
         $existing = User::where('profile_id', '!=', $pid)->whereExpoToken($expoToken)->count();
-        abort_if($existing, 400, 'Push token is already used by another account');
+        abort_if($existing && $existing > 5, 400, 'Push token is already used by another account');
 
 
         $request->user()->update([
         $request->user()->update([
             'notify_enabled' => $request->boolean('notify_enabled'),
             'notify_enabled' => $request->boolean('notify_enabled'),