Skip to content
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

Merged
merged 44 commits into from
Mar 12, 2025
Merged

Session Management #486

merged 44 commits into from
Mar 12, 2025

Conversation

moe-dev
Copy link
Contributor

@moe-dev moe-dev commented Jan 30, 2025

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.

@moe-dev moe-dev changed the title Session Management Session Management [WIP] Jan 30, 2025
Copy link

codesandbox-ci bot commented Jan 30, 2025

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:

Sandbox Source
@turnkey/example-react-components Configuration

@moe-dev moe-dev changed the title Session Management [WIP] Session Management Mar 7, 2025
@moe-dev moe-dev marked this pull request as ready for review March 7, 2025 16:51
@turnekybc turnekybc self-requested a review March 10, 2025 22:01
@andrewkmin andrewkmin self-requested a review March 11, 2025 17:48
@turnekybc turnekybc requested a review from amircheikh March 11, 2025 21:10
@turnekybc turnekybc requested a review from moeodeh3 March 11, 2025 21:24
### @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
Copy link
Collaborator

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?

Copy link
Contributor

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;
Copy link
Collaborator

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

Copy link
Contributor

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?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup!! That makes sense

@turnekybc turnekybc force-pushed the moe/session-management branch from fe943e3 to 98b7a9d Compare March 12, 2025 16:32
@turnekybc turnekybc merged commit 044e2d2 into main Mar 12, 2025
5 checks passed
@turnekybc turnekybc deleted the moe/session-management branch March 12, 2025 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants