Zaid-Ajaj / Fable.Remoting

Type-safe communication layer (RPC-style) for F# featuring Fable and .NET Apps
https://zaid-ajaj.github.io/Fable.Remoting/
MIT License
272 stars 55 forks source link

How should I handle 401 and 403 errors when using Fable.Remoting? #340

Closed mrakgr closed 1 year ago

mrakgr commented 1 year ago

JWT tokens have a short duration, so I am worried about getting a 401 response from the server in the middle of the session. I want a way to be notified of them when the request fails so I can rebuild the Remoting proxy with a new one. A Google search and a skim through the docs is turning up nothing for me, sorry if I missed this being answered somewhere.

mrakgr commented 1 year ago

I figured it out with a simple test. It seems it just throws the ProxyRequestException in the failure case.

Screenshot (179)