-
Notifications
You must be signed in to change notification settings - Fork 0
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
Introduce force-an-org example with clerk-js
custom flow
#25
base: main
Are you sure you want to change the base?
Conversation
e4f1c9e
to
7ac9178
Compare
529435c
to
45ed87b
Compare
45ed87b
to
f72d0b9
Compare
|
||
// Check for any pending tasks (like organization creation) and display the corresponding UI element | ||
async function displayNextTaskIfAny() { | ||
const task = clerk.currentTask; |
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 think this should be abstracted into a method. Something like clerk.getCurrentTask()
.
If in the future, we want to abstract the logic of ordering tasks by priority, the SDK could handle this based on the task metadata so that the developer wouldn't have to manually orchestrate it.
}; | ||
|
||
// Here we're toggling UI visibility, but you could also navigate to different pages | ||
// with `Clerk.__experimental_nextTask({ redirectUrlComplete })` |
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.
🤔 Considering deprecating nextTask
in favor of navigateToTask
to be super explicit about it's intent.
The main goal of this method is to abstract the logic of navigation from a pending
to an active
transition. The SDK has to deal with a lot of internal complexity on behalf of the developer, such as setting a transitive state for accessors and doing the actual status transition check.
|
||
// Now that the user is created, set the session to active. | ||
// TODO: Update this with clerk.setCurrentSession(signUpAttempt.createdSessionId) | ||
await clerk.setActive({ session: signUpAttempt.createdSessionId }); |
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.
setActive
needs to be deprecated in favor of the current
nomenclature. It's on my list to work once I'm back from vacation.
clerk-js
clerk-js
clerk-js
clerk-js
clerk-js
clerk-js
custom flow
Resolves ORGS-602
Introduces example of how to build custom flows with force-an-org enabled using pure
clerk-js