View Source WorkOS.Passwordless (WorkOS SDK for Elixir v0.2.0)
The Passwordless module provides convenience methods for working with passwordless sessions including the WorkOS Magic Link. You'll need a valid API key.
Link to this section Summary
Link to this section Functions
Create a Passwordless Session.
parameters
Parameters
- params (map)
- email (string) The email of the user to authenticate.
- state (string) Optional parameter that the redirect URI received from WorkOS will contain. The state parameter can be used to encode arbitrary information to help restore application state between redirects.
- type (string) The type of Passwordless Session to create. Currently, the only supported value is 'MagicLink'.
- redirect_uri (string) The URI where users are directed after completing the authentication step. Must match a configured redirect URI on your WorkOS dashboard.
example
Example
WorkOS.Passwordless.create_session(%{ email: "example@workos.com", redirect_uri: "https://workos.com/passwordless" })
Send a Passwordless Session via email.
parameters
Parameters
- session_id (string) The unique identifier of the Passwordless Session to send an email for.
example
Example
WorkOS.Passwordless.send_session("passwordless_session_12345")