You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I am using the connect RPC client in a Sveltekit applications and on the client transport I have an authentication interceptor. The interceptor manages the access token, adding it to the requests Authorization header if it is valid, but if the token is expired or not present the interceptor throws a redirect error as documented for Sveltekit.
The problem is that currently this redirect error gets converted to a connect error by the setupSignal function which prevents the Sveltekit behaviour of redirecting when this error is detected. This seems like a reasonable use case and is currently not possible.
Describe the solution you'd like
I am not sure what the best way to implement this features is, but two options would be:
A transport option to prevent error conversion
A transport option that allows you to extend the error handling behaviour
Describe alternatives you've considered
This is the only way I see this currently working, but this defeats the purpose of the interceptor if on every call I need to manually add error handling.
It wasn't possible to use cause for a long time, but it's widely available now. We've filed sveltejs/kit#13487, asking whether they're open to support cause when looking for a redirect error.
Is your feature request related to a problem? Please describe.
I am using the connect RPC client in a Sveltekit applications and on the client transport I have an authentication interceptor. The interceptor manages the access token, adding it to the requests
Authorization
header if it is valid, but if the token is expired or not present the interceptor throws aredirect
error as documented for Sveltekit.The problem is that currently this redirect error gets converted to a connect error by the
setupSignal
function which prevents the Sveltekit behaviour of redirecting when this error is detected. This seems like a reasonable use case and is currently not possible.Describe the solution you'd like
I am not sure what the best way to implement this features is, but two options would be:
Describe alternatives you've considered
This is the only way I see this currently working, but this defeats the purpose of the interceptor if on every call I need to manually add error handling.
The text was updated successfully, but these errors were encountered: