Open amjadfqs opened 1 month ago
We don't have an example, but here's a basic interceptor:
import type { Interceptor } from "@connectrpc/connect";
function interceptor(): Interceptor {
let token = "abc";
return (next) => async (req) => {
req.header.set("token", token);
return await next(req);
}
}
You can add arguments to configure the interceptor, hold state in the function body, and perform a refresh in the returned async function.
Is there any example for interceptor auth that refresh the token whenever it expires.
Thanks in advance.