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
better to have an interface to allow api fetching customizable
Non-Goals
No response
Background
on my server side, i have a rate-limiter which will block auth apis from requesting too fast (middleware layer), when it takes effect, it will directly respond with status error & some simple text (not json), this response will be received by the signIn method (it uses fetch) which will cause data.json() error.
btw, i need to know some header values fetched by signIn method but there is no way to get it because the request was wrapped in the signIn method.
Proposal
add an new option into the NextAuthOptions, something like "apiClient": axios.create(),
and then in signIn method (or where sends requests): (options.apiClient || fetch).doRequest...
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Goals
better to have an interface to allow api fetching customizable
Non-Goals
No response
Background
on my server side, i have a rate-limiter which will block auth apis from requesting too fast (middleware layer), when it takes effect, it will directly respond with status error & some simple text (not json), this response will be received by the
signIn
method (it usesfetch
) which will causedata.json()
error.btw, i need to know some header values fetched by
signIn
method but there is no way to get it because the request was wrapped in thesignIn
method.Proposal
add an new option into the
NextAuthOptions
, something like"apiClient": axios.create()
,and then in
signIn
method (or where sends requests):(options.apiClient || fetch).doRequest...
Beta Was this translation helpful? Give feedback.
All reactions