Skip to content

Commit c9ae91c

Browse files
committed
Merge branch 'master' into firestore
Change-Id: I991577c7f32ff1ab08615149b6d98ff59555ea8c
2 parents 24cc682 + e673c24 commit c9ae91c

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/get_service_account_tokens.js renamed to auth/get_service_account_tokens.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
16+
'use strict';
1717
// [START get_service_account_tokens]
18-
var admin = require("firebase-admin");
18+
const admin = require('firebase-admin');
1919

20-
var serviceAccount = require("path/to/serviceAccountKey.json");
21-
var credential = admin.credential.cert(serviceAccount);
20+
const serviceAccount = require('path/to/serviceAccountKey.json');
21+
const credential = admin.credential.cert(serviceAccount);
2222

23-
credential.getAccessToken().then(function(accessTokenInfo) {
24-
var accessToken = accessTokenInfo.access_token;
25-
var expirationTime = accessTokenInfo.expires_in;
23+
credential.getAccessToken().then((accessTokenInfo) => {
24+
const accessToken = accessTokenInfo.access_token;
25+
const expirationTime = accessTokenInfo.expires_in;
2626

2727
// Attach accessToken to HTTPS request in the "Authorization: Bearer" header
2828
// After expirationTime, you must generate a new access token
2929
// [START_EXCLUDE]
30-
console.log("The token " + accessToken + " expires in " + expirationTime);
30+
console.log(`The token ${accessToken} expires in ${expirationTime}`);
3131
// [END_EXCLUDE]
3232
});
3333
// [END get_service_account_tokens]

package.json renamed to auth/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "snippets-node",
2+
"name": "snippets-node-auth",
33
"version": "1.0.0",
44
"description": "Code snippets used in Node.js documentation on firebase.google.com",
55
"author": "Firebase (https://firebase.google.com/)",

0 commit comments

Comments
 (0)