File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -21,4 +21,12 @@ admin.auth().verifyIdToken(idToken).then((claims) => {
2121 // Allow access to requested admin resource.
2222 }
2323} ) ;
24- // [END verify_custom_claims]
24+ // [END verify_custom_claims]
25+
26+ // [START read_custom_user_claims]
27+ // Lookup the user associated with the specified uid.
28+ admin . auth ( ) . getUser ( uid ) . then ( ( userRecord ) => {
29+ // The claims can be accessed on the user record.
30+ console . log ( userRecord . customClaims . admin ) ;
31+ } ) ;
32+ // [END read_custom_user_claims]
Original file line number Diff line number Diff line change @@ -22,6 +22,20 @@ const actionCodeSettings = {
2222} ;
2323// [END init_action_code_settings]
2424
25+ // [START password_reset_link]
26+ // Admin SDK API to generate the password reset link.
27+ const userEmail = 'user@example.com' ;
28+ admin . auth ( ) . generatePasswordResetLink ( userEmail , actionCodeSettings )
29+ . then ( ( link ) => {
30+ // Construct password reset email template, embed the link and send
31+ // using custom SMTP server.
32+ return sendCustomPasswordResetEmail ( email , displayName , link ) ;
33+ } )
34+ . catch ( ( error ) => {
35+ // Some error occurred.
36+ } ) ;
37+ // [END password_reset_link]
38+
2539// [START email_verification_link]
2640// Admin SDK API to generate the password reset link.
2741const email = 'user@example.com' ;
You can’t perform that action at this time.
0 commit comments