Skip to content

Commit

Permalink
Merge pull request #1474 from appwrite/update-magic-url-doc
Browse files Browse the repository at this point in the history
Add url param and explanation to magic url doc
  • Loading branch information
stnguyen90 authored Nov 5, 2024
2 parents d41fd8c + c13fb5e commit a151f19
Showing 1 changed file with 11 additions and 3 deletions.
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

0 comments on commit a151f19

Please sign in to comment.