From 2d250fee64e3f70db1c135d53ef662663d3b82d8 Mon Sep 17 00:00:00 2001 From: Ebenezer Don Date: Mon, 4 Nov 2024 15:48:09 +0000 Subject: [PATCH 1/2] Add url param and explanation to magic url doc --- .../docs/products/auth/magic-url/+page.markdoc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/routes/docs/products/auth/magic-url/+page.markdoc b/src/routes/docs/products/auth/magic-url/+page.markdoc index 22b7a035f7..768e08cc6b 100644 --- a/src/routes/docs/products/auth/magic-url/+page.markdoc +++ b/src/routes/docs/products/auth/magic-url/+page.markdoc @@ -20,14 +20,19 @@ const client = new Client() const account = new Account(client); -const token = await account.createMagicURLToken(ID.unique(), 'email@example.com'); +const token = await account.createMagicURLToken( + ID.unique(), + 'email@example.com', + 'https://example.com/verify' +); ``` ```graphql mutation { accountCreateMagicURLToken( userId: "ID.unique()", - email: "email@example.com" + email: "email@example.com", + url: "https://example.com/verify" ) { _id _createdAt @@ -40,9 +45,13 @@ 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. +If you're building a mobile app, you can leave the URL parameter empty to use your Appwrite instance's default handling. + # 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 %} From c13fb5e9bafb39f3580334b1c67ce6313634e7ad Mon Sep 17 00:00:00 2001 From: Ebenezer Don Date: Tue, 5 Nov 2024 08:17:28 +0000 Subject: [PATCH 2/2] Update src/routes/docs/products/auth/magic-url/+page.markdoc Co-authored-by: Steven Nguyen <1477010+stnguyen90@users.noreply.github.com> --- src/routes/docs/products/auth/magic-url/+page.markdoc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/routes/docs/products/auth/magic-url/+page.markdoc b/src/routes/docs/products/auth/magic-url/+page.markdoc index 768e08cc6b..4506fbcd9c 100644 --- a/src/routes/docs/products/auth/magic-url/+page.markdoc +++ b/src/routes/docs/products/auth/magic-url/+page.markdoc @@ -47,7 +47,6 @@ mutation { 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. -If you're building a mobile app, you can leave the URL parameter empty to use your Appwrite instance's default handling. # Login {% #login %}