Bearer Authorisation on request time using better-fetch

Hey everyone, I just swapped our custom http client to better fetch, and I am really happy so far. However, I have 2 questions that would save my life: 1. Since the type of app we're building is an admin app which should attach the Bearer ${access_token} in 99.99% of the requests, I was wondering if there was a way to use the init plugin or just the onRequest hook to attach it without having to call my const session = await auth() and then to attach the
auth: {
type: "Bearer",
token: session?.user?.accessToken
}
auth: {
type: "Bearer",
token: session?.user?.accessToken
}
in each request (as described in the docs). The token callback function can't be async, so I know i can't attach the header there 2. It's really cool that you provide a logger, but I was wondering if this logger can be used in the app as well, or is it strictly bound to
plugins: [
logger(),
],
plugins: [
logger(),
],
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?