File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+ const admin = require ( 'firebase-admin' ) ;
3+
14// Initialize the Admin app with the default appication credentials
25// [START initialize_sdk_with_default_config]
36admin . initializeApp ( ) ;
@@ -11,28 +14,28 @@ admin.initializeApp({
1114// [END initialize_sdk_with_service_account_id]
1215
1316// [START custom_token]
14- var uid = " some-uid" ;
17+ var uid = ' some-uid' ;
1518
1619admin . auth ( ) . createCustomToken ( uid )
1720 . then ( function ( customToken ) {
1821 // Send token back to client
1922 } )
2023 . catch ( function ( error ) {
21- console . log ( " Error creating custom token:" , error ) ;
24+ console . log ( ' Error creating custom token:' , error ) ;
2225 } ) ;
2326// [END custom_token]
2427
2528// [START custom_token_with_claims]
26- var uid = " some-uid" ;
29+ var userId = ' some-uid' ;
2730var additionalClaims = {
2831 premiumAccount : true
2932} ;
3033
31- admin . auth ( ) . createCustomToken ( uid , additionalClaims )
34+ admin . auth ( ) . createCustomToken ( userId , additionalClaims )
3235 . then ( function ( customToken ) {
3336 // Send token back to client
3437 } )
3538 . catch ( function ( error ) {
36- console . log ( " Error creating custom token:" , error ) ;
39+ console . log ( ' Error creating custom token:' , error ) ;
3740 } ) ;
3841// [END custom_token_with_claims]
You can’t perform that action at this time.
0 commit comments