mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-18 19:13:17 +00:00
Update ApiV1Dot1Controller, allow upto 5 similar push tokens
This commit is contained in:
parent
989a8e9328
commit
7820b506d8
1 changed files with 1 additions and 1 deletions
|
@ -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'),
|
||||||
|
|
Loading…
Reference in a new issue