Skip to content

Expose some helpers for manually creating session on callback #46

Description

@JClackett

Hi!

Little context...so im trying to build a flow that allows a user to sign up via link.

Currently, the link redirects to workos with a inviteCode in state. The callback from workos then calls the handleCallbackRoute function from this package in my route handler.

However, if I want to validate that the token/signup is valid, e.g. the invite isnt expired, or revoked, or incorrect email used. Where can I do this? because currently theres only a onSuccess callback but this runs after already creating the session? so from the users perspective if I accidentally choose the wrong email and the invite isnt valid im now logged in.

I guess in the onSuccess I can try log them back out again, but is there no way to hook into the process between verifying the code and getting the authResponse and the actual session creation?

Curious as to how best to handle this use case

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions