@@ -38,35 +38,39 @@ getAuth()
38
38
} ) ;
39
39
// [END password_reset_link]
40
40
41
- // [START email_verification_link]
42
- // Admin SDK API to generate the email verification link.
43
- const useremail = '[email protected] ' ;
44
- getAuth ( )
45
- . generateEmailVerificationLink ( useremail , actionCodeSettings )
46
- . then ( ( link ) => {
47
- // Construct email verification template, embed the link and send
48
- // using custom SMTP server.
49
- return sendCustomVerificationEmail ( useremail , displayName , link ) ;
50
- } )
51
- . catch ( ( error ) => {
52
- // Some error occurred.
53
- } ) ;
54
- // [END email_verification_link]
41
+ function emailVerificationLink ( ) {
42
+ // [START email_verification_link]
43
+ // Admin SDK API to generate the email verification link.
44
+ const useremail = '[email protected] ' ;
45
+ getAuth ( )
46
+ . generateEmailVerificationLink ( useremail , actionCodeSettings )
47
+ . then ( ( link ) => {
48
+ // Construct email verification template, embed the link and send
49
+ // using custom SMTP server.
50
+ return sendCustomVerificationEmail ( useremail , displayName , link ) ;
51
+ } )
52
+ . catch ( ( error ) => {
53
+ // Some error occurred.
54
+ } ) ;
55
+ // [END email_verification_link]
56
+ }
55
57
56
- // [START sign_in_with_email_link]
57
- // Admin SDK API to generate the sign in with email link.
58
- const usremail = '[email protected] ' ;
59
- getAuth ( )
60
- . generateSignInWithEmailLink ( usremail , actionCodeSettings )
61
- . then ( ( link ) => {
62
- // Construct sign-in with email link template, embed the link and
63
- // send using custom SMTP server.
64
- return sendSignInEmail ( usremail , displayName , link ) ;
65
- } )
66
- . catch ( ( error ) => {
67
- // Some error occurred.
68
- } ) ;
69
- // [END sign_in_with_email_link]
58
+ function signInWithEmailLink ( ) {
59
+ // [START sign_in_with_email_link]
60
+ // Admin SDK API to generate the sign in with email link.
61
+ const useremail = '[email protected] ' ;
62
+ getAuth ( )
63
+ . generateSignInWithEmailLink ( useremail , actionCodeSettings )
64
+ . then ( ( link ) => {
65
+ // Construct sign-in with email link template, embed the link and
66
+ // send using custom SMTP server.
67
+ return sendSignInEmail ( useremail , displayName , link ) ;
68
+ } )
69
+ . catch ( ( error ) => {
70
+ // Some error occurred.
71
+ } ) ;
72
+ // [END sign_in_with_email_link]
73
+ }
70
74
71
75
let displayName ;
72
76
const sendSignInEmail = ( ...args ) => {
0 commit comments