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.

@see https://workos.com/docs/sso/configuring-magic-link

Link to this section Summary

Functions

Create a Passwordless Session.

Send a Passwordless Session via email.

Link to this section Functions

Link to this function

create_session(params, opts \\ [])

View Source

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" })

Link to this function

send_session(session_id, opts \\ [])

View Source

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")