1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-22 07:42:41 +00:00

Merge pull request #5324 from pixelfed/staging

Update ApiV1Dot1Controller, allow upto 5 similar push tokens
This commit is contained in:
daniel 2024-10-08 02:26:38 -06:00 committed by GitHub
commit b3bd941c82
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1139,7 +1139,7 @@ class ApiV1Dot1Controller extends Controller
$expoToken = $request->input('token');
$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([
'notify_enabled' => $request->boolean('notify_enabled'),