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:
-
Is it possible for the user to become authorized during the lifetime of the subscription? If yes, then it should be
this.ready()
-
If no. 1 is false but the user was authorized then became non-authorized, then it should be
this.stop()
-
If not no. 1 nor no. 2, then return
null
2 Likes