-
Notifications
You must be signed in to change notification settings - Fork 19
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
Session Management #486
Session Management #486
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 2b8c960:
|
### @turnkey/sdk-react | ||
|
||
- update `TurnkeyContext` to use new `.getSession()` method to check if there is an active session | ||
- `OTPVerification` component no longer receives `authIframeClient` or `onValidateSuccess` props |
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.
optional: mind sharing what the rationale is/how we now achieve the same effect?
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.
I'm obtaining a reference to the authIframeClient
directly in the OTPVerification
component via the useTurnkey()
hook.
Depending on the use case, I am handling the equivalent of onValidateSuccess
in Auth.tsx
or directly within OTPVerification
itself.
type Session = { | ||
sessionType: string; | ||
sessionType: SessionType; |
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.
same comment as a similar spot in sdk-browser
— documenting these types could be useful, if not too inconvenient
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.
@andrewkmin they should be able to refer to the enum above?
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.
Yup!! That makes sense
Co-authored-by: am <andrew@turnkey.io>
fe943e3
to
98b7a9d
Compare
Summary & Motivation
How I Tested These Changes
Did you add a changeset?
If updating one of our packages, you'll likely need to add a changeset to your PR. To do so, run
pnpm changeset
.pnpm changeset
will generate a file where you should write a human friendly message about the changes. Note how this (example) includes the package name (should be auto added by the command) along with the type of semver change (major.minor.patch) (which you should set).These changes will be used at release time to determine what packages to publish and how to bump their version. For more context see this comment.