pusher / push-notifications-web

Beams Browser notifications
MIT License
39 stars 20 forks source link

Invalid JWT claims: Token used before issued when setUserId #79

Closed ghost closed 3 years ago

ghost commented 3 years ago

i wanted to create a systeme of push notifaction in the web with specific user targeted, i used this doc to realise it https://pusher.com/docs/beams/guides/publish-to-specific-user/web after the creation of beams auth endpoint i used the function setUserId but after having the token from my backend i have this error from the pusher url : PUT https://f267b5da-71c9-4da2-9feb-c8181f624d09.pushnotifications.pusher.com/device_api/v1/instances/f267b5da-71c9-4da2-9feb-c8181f624d09/devices/web/web-cfab6639-1c48-4d10-844e-1fc0200e8fac/user

with error

error "Unauthorized"
description "Invalid JWT claims: Token used before issued"

why i have the problem of checking issued ? how can i solve it, thanks

benw-pusher commented 3 years ago

Are you using the same token for all requests? Each invocation of setUserID will cause a new authentication request to your authentication server, upon receipt of such a request your auth endpoint should respond by generating and returning a new token.

madaher-dev commented 3 years ago

How did you end up solving this. I am having the same issue. Thx