Cancelling unauthorized subscription

Hi,
What is the best way to refuse unauthorized subscription ?
returning this.ready() or this.stop() ?
Can we use this.stop() before returning any cursor ?
Thank you for your help.

1 Like

I usually use this.ready().

Official way is return null.

There are cases that you need to consider:

  1. Is it possible for the user to become authorized during the lifetime of the subscription? If yes, then it should be this.ready()

  2. If no. 1 is false but the user was authorized then became non-authorized, then it should be this.stop()

  3. If not no. 1 nor no. 2, then return null

2 Likes