Skip to content

Commit b5a1e4e

Browse files
committed
authorized-https-endpoint: getToken deprecated
The `getToken` method has been deprecated and replaced with `getIdToken`.
1 parent d396558 commit b5a1e4e

File tree

1 file changed

+2
-2
lines changed
  • authorized-https-endpoint/public

1 file changed

+2
-2
lines changed

authorized-https-endpoint/public/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Demo.prototype.signOut = function() {
6363

6464
// Does an authenticated request to a Firebase Functions endpoint using an Authorization header.
6565
Demo.prototype.startFunctionsRequest = function() {
66-
firebase.auth().currentUser.getToken().then(function(token) {
66+
firebase.auth().currentUser.getIdToken().then(function(token) {
6767
console.log('Sending request to', this.helloUserUrl, 'with ID token in Authorization header.');
6868
var req = new XMLHttpRequest();
6969
req.onload = function() {
@@ -81,7 +81,7 @@ Demo.prototype.startFunctionsRequest = function() {
8181
// Does an authenticated request to a Firebase Functions endpoint using a __session cookie.
8282
Demo.prototype.startFunctionsCookieRequest = function() {
8383
// Set the __session cookie.
84-
firebase.auth().currentUser.getToken(true).then(function(token) {
84+
firebase.auth().currentUser.getIdToken(true).then(function(token) {
8585
// set the __session cookie
8686
document.cookie = '__session=' + token + ';max-age=3600';
8787

0 commit comments

Comments
 (0)