-
-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: β¨ add flag to disable getSession after signIn on local / refresh provider #702
base: main
Are you sure you want to change the base?
feat: β¨ add flag to disable getSession after signIn on local / refresh provider #702
Conversation
Hi @bitfactory-frank-spee , thanks for your contribution, it looks good to me. I will come back to it after #694 , so that we can ensure that it's functionally good. |
@bitfactory-frank-spee Could you please sync your PR with the current main? |
@phoenix-ru I will update it this week π |
Done π |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @bitfactory-frank-spee π
Very close to being done! I have one minor renaming request and then we should be good to go, to release this in 0.8!
@@ -103,12 +105,16 @@ await signIn(credentials, { callbackUrl: '/protected' }) | |||
// Trigger a sign-in with a redirect afterwards to an external page (if set, this will cause a hard refresh of the page) | |||
await signIn(credentials, { callbackUrl: 'https://sidebase.io', external: true }) | |||
|
|||
// Trigger a sign-in without calling getSession directly. You have to manually call it to get session data. | |||
await signIn(credentials, { withGetSession: false }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we rename this new option from withGetSession
to just getSession
? I think this would be a bit more readable!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Zoey, you just caught me on holiday π΄. I will change it asap, next week for certain. I will try to do it sooner.
Renaming is fine by me. I don't totally agree with the name change. Because it is a boolean you want to name it like is...
, has...
, with...
or something like that, and not a get/set/action like method name.
So I would suggest just withSession
or without 'with', e.g. something like callSession
or just session
. But again all names are fine by me. Just giving my opinion to get it as good as possible.
π Linked issue
#701
β Type of change
π Description
See issue for clarification. This adds a flag to the signInOptions named
withGetSession
which defaults to true. This makes sure this will be backwards compatible. WhenwithGetSession === false
thegetSession
method will not be called.This also includes a bug fix (681fdb0) where refresh was not equal to local provider.
π Checklist