Skip to content

Commit dd16912

Browse files
committed
Set tenantId and remove redirectUri
1 parent 42a0f85 commit dd16912

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

packages/auth/src/api/authentication/token.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ describe('requestStsToken', () => {
147147

148148
describe('api/authentication/revokeToken', () => {
149149
const request = {
150-
provider_id: 'provider-id',
150+
providerId: 'provider-id',
151151
tokenType: TokenType.ACCESS_TOKEN,
152152
token: 'token',
153153
idToken: 'id-token'

packages/auth/src/api/authentication/token.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,11 @@ export interface RequestStsTokenResponse {
5252
}
5353

5454
export interface RevokeTokenRequest {
55-
provider_id: string;
55+
providerId: string;
5656
tokenType: TokenType;
5757
token: string;
5858
idToken: string;
5959
tenantId?: string;
60-
redirectUri?: string;
6160
}
6261

6362
export interface RevokeTokenResponse {}

packages/auth/src/core/auth/auth_impl.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,11 @@ import { _getInstance } from '../util/instantiator';
6363
import { _getUserLanguage } from '../util/navigator';
6464
import { _getClientVersion } from '../util/version';
6565
import { HttpHeader } from '../../api';
66-
import { TokenType, revokeToken } from '../../api/authentication/token';
66+
import {
67+
RevokeTokenRequest,
68+
TokenType,
69+
revokeToken
70+
} from '../../api/authentication/token';
6771
import { AuthMiddlewareQueue } from './middleware';
6872
import { RecaptchaConfig } from '../../platform_browser/recaptcha/recaptcha';
6973
import { _logWarn } from '../util/log';
@@ -522,12 +526,16 @@ export class AuthImpl implements AuthInternal, _FirebaseService {
522526
if (this.currentUser) {
523527
const idToken = await this.currentUser.getIdToken();
524528
// Generalize this to accept other providers once supported.
525-
const response = await revokeToken(this, {
526-
provider_id: 'apple.com',
529+
const request: RevokeTokenRequest = {
530+
providerId: 'apple.com',
527531
tokenType: TokenType.ACCESS_TOKEN,
528532
token: token,
529533
idToken: idToken
530-
});
534+
};
535+
if (this.tenantId != null) {
536+
request.tenantId = this.tenantId;
537+
}
538+
await revokeToken(this, request);
531539
}
532540
}
533541

0 commit comments

Comments
 (0)