Initial websockets getToken() returns null: next-auth + websockets :)
Hello!
So the way I am trying to authenticate websockets is like this:
And it works except for the initial requests. I wouldn't mind this (maybe I would since needless errors), but my problem is trying to use subscriptions: it just will prompt an error on the initial request and I can't think of a way to retry (retrying works for everything else). I would like to solve this initial null JWT token request problem as that would make everything work very nicely but I wouldn't mind making the subscriptions work either.
The way I am subscribing in my react component:
I would really appreciate some commentary/insight! Thank you for your time.
So the way I am trying to authenticate websockets is like this:
And it works except for the initial requests. I wouldn't mind this (maybe I would since needless errors), but my problem is trying to use subscriptions: it just will prompt an error on the initial request and I can't think of a way to retry (retrying works for everything else). I would like to solve this initial null JWT token request problem as that would make everything work very nicely but I wouldn't mind making the subscriptions work either.
The way I am subscribing in my react component:
I would really appreciate some commentary/insight! Thank you for your time.