I have this working in a project to a Hasura backend using subscriptions. I am authenticating by adding an ID Token from google auth to the connectingPayload.
The validity of the ID token from google is 1 hour, and I am trying to honour that in Hasura with only allowing the connection to remain valid for the remaining validity of the token when received.
Unfortunately that means I need to change the token in the payload when it has expired, and reconnect the web socket.
I am currently thinking the only way to do this is to create a new WebSocketTransport in
func webSocketTransport(_ webSocketTransport: WebSocketTransport, didDisconnectWithError error:Error?)
But the problem is I have some active subscriptions going on when this happens, and they don't reconnect unless manually made to do so.
Am I missing something here, or is their no easy/clean way way to handle the currently in the framework?
Thanks
Gareth
I have this working in a project to a Hasura backend using subscriptions. I am authenticating by adding an ID Token from google auth to the connectingPayload.
The validity of the ID token from google is 1 hour, and I am trying to honour that in Hasura with only allowing the connection to remain valid for the remaining validity of the token when received.
Unfortunately that means I need to change the token in the payload when it has expired, and reconnect the web socket.
I am currently thinking the only way to do this is to create a new WebSocketTransport in
func webSocketTransport(_ webSocketTransport: WebSocketTransport, didDisconnectWithError error:Error?)But the problem is I have some active subscriptions going on when this happens, and they don't reconnect unless manually made to do so.
Am I missing something here, or is their no easy/clean way way to handle the currently in the framework?
Thanks
Gareth