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

Add url param and explanation to magic url doc #1474

Merged
merged 2 commits into from
Nov 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/routes/docs/products/auth/magic-url/+page.markdoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,19 @@ const client = new Client()

const account = new Account(client);

const token = await account.createMagicURLToken(ID.unique(), '[email protected]');
const token = await account.createMagicURLToken(
ID.unique(),
'[email protected]',
'https://example.com/verify'
);
```

```graphql
mutation {
accountCreateMagicURLToken(
userId: "ID.unique()",
email: "[email protected]"
email: "[email protected]",
url: "https://example.com/verify"
) {
_id
_createdAt
Expand All @@ -40,9 +45,12 @@ mutation {

{% /multicode %}

The `url` parameter specifies where users will be redirected after clicking the magic link.
The secret and userId will be automatically appended as query parameters to this URL.

# Login {% #login %}

After receiving your secret from an email, you can create a session.
After the user clicks the magic link in their email, they will be redirected to your specified URL with the secret and userId as query parameters. Use these parameters to create a session.

{% multicode %}

Expand Down
Loading