feat: ✨ add flag to disable getSession after signIn on local / refresh provider #701
Closed
3 of 5 tasks
Labels
enhancement
An improvement that needs to be added
Describe the feature
With the
signIn
method it should be possible to optionally do agetSession
so you can manually call for session data and manually handle the errors coming from thegetSession
endpoint.How would you implement this?
I created a PR: #702
Additional information
Some extra information why we need this:
Our 2FA/OTP middleware on the Laravel API returns a
428
error onuser/me
(or any other endpoint if 2FA is needed). ThesignIn
method always callsgetSession
, and the error from theuser/me
API endpoint dies ingetSession
(clearing the token etc.). Because this catch we need to manually call theuser/me
endpoint outside this module. So right now we want to prevent thegetSession
getting called so we still have the token etc. and call it manually.Another solution could also be to allow the API error(s) from
getSession
bubble through (and not clear the token etc. immediately) or create some kind of hook so we can intercept on special errors like a 428. This is more work and need more design to be able to create this for local and refresh provider without drifting to far from theauthjs
provider.Provider
The text was updated successfully, but these errors were encountered: