From 717e2e67db6f34101a5559c4503d2f17c8122c75 Mon Sep 17 00:00:00 2001 From: peili Date: Wed, 25 Nov 2020 14:40:46 +0100 Subject: [PATCH 1/2] Fix typo in useremail --- auth/email_action_links.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/auth/email_action_links.js b/auth/email_action_links.js index a6055f0a..5192158f 100644 --- a/auth/email_action_links.js +++ b/auth/email_action_links.js @@ -71,14 +71,14 @@ admin // [START sign_in_with_email_link] // Admin SDK API to generate the sign in with email link. -const usremail = 'user@example.com'; +const useremail = 'user@example.com'; admin .auth() - .generateSignInWithEmailLink(usremail, actionCodeSettings) + .generateSignInWithEmailLink(useremail, actionCodeSettings) .then((link) => { // Construct sign-in with email link template, embed the link and // send using custom SMTP server. - return sendSignInEmail(usremail, displayName, link); + return sendSignInEmail(useremail, displayName, link); }) .catch((error) => { // Some error occurred. From 672a67ec964c32cf14474109e589726dbbdd1107 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ros=C3=A1rio=20Pereira=20Fernandes?= Date: Tue, 17 May 2022 14:14:51 +0100 Subject: [PATCH 2/2] Update email_action_links.js --- auth/email_action_links.js | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/auth/email_action_links.js b/auth/email_action_links.js index f5e22767..5c21b09d 100644 --- a/auth/email_action_links.js +++ b/auth/email_action_links.js @@ -55,20 +55,22 @@ function emailVerificationLink() { // [END email_verification_link] } -// [START sign_in_with_email_link] -// Admin SDK API to generate the sign in with email link. -const usremail = 'user@example.com'; -getAuth() - .generateSignInWithEmailLink(usremail, actionCodeSettings) - .then((link) => { - // Construct sign-in with email link template, embed the link and - // send using custom SMTP server. - return sendSignInEmail(useremail, displayName, link); - }) - .catch((error) => { - // Some error occurred. - }); -// [END sign_in_with_email_link] +function signInWithEmailLink() { + // [START sign_in_with_email_link] + // Admin SDK API to generate the sign in with email link. + const useremail = 'user@example.com'; + getAuth() + .generateSignInWithEmailLink(useremail, actionCodeSettings) + .then((link) => { + // Construct sign-in with email link template, embed the link and + // send using custom SMTP server. + return sendSignInEmail(useremail, displayName, link); + }) + .catch((error) => { + // Some error occurred. + }); + // [END sign_in_with_email_link] +} let displayName; const sendSignInEmail = (...args) => {