diff --git a/app/controllers/ajax/web_push_controller.rb b/app/controllers/ajax/web_push_controller.rb index d6ef3032..e9723c54 100644 --- a/app/controllers/ajax/web_push_controller.rb +++ b/app/controllers/ajax/web_push_controller.rb @@ -14,7 +14,7 @@ class Ajax::WebPushController < AjaxController def check params.permit(:endpoint) - found = WebPushSubscription.where("subscription ->> 'endpoint' = ?", params[:endpoint]).first + found = current_user.web_push_subscriptions.where("subscription ->> 'endpoint' = ?", params[:endpoint]).first @response[:status] = if found if found.failures >= 3