Skip to content

Commit fb70a71

Browse files
committed
Using expiry_in returned by backend
1 parent f8410db commit fb70a71

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,12 @@ describe('api/authentication/exchange_token', () => {
5252
const mock = mockRegionalEndpointWithParent(
5353
RegionalEndpoint.EXCHANGE_TOKEN,
5454
'test-parent',
55-
{ accessToken: 'outbound-token' }
55+
{ accessToken: 'outbound-token', expiresIn: '1000' }
5656
);
5757

5858
const response = await exchangeToken(regionalAuth, request);
5959
expect(response.accessToken).equal('outbound-token');
60+
expect(response.expiresIn).equal('1000');
6061
expect(mock.calls[0].request).to.eql({
6162
parent: 'test-parent',
6263
token: 'custom-token'

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export interface ExchangeTokenRequest {
2828

2929
export interface ExchangeTokenRespose {
3030
accessToken: string;
31+
expiresIn?: string;
3132
}
3233

3334
export async function exchangeToken(

packages/auth/src/core/strategies/exchange_token.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ describe('core/strategies/exchangeToken', () => {
4747
const mock = mockRegionalEndpointWithParent(
4848
RegionalEndpoint.EXCHANGE_TOKEN,
4949
'projects/test-project-id/locations/us/tenants/tenant-1/idpConfigs/idp-config',
50-
{ accessToken: 'outbound-token' }
50+
{ accessToken: 'outbound-token', expiresIn: '1000' }
5151
);
5252

5353
const accessToken = await exchangeToken(

packages/auth/src/core/strategies/exhange_token.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { _castAuth } from '../auth/auth_impl';
2727
* for an OidcToken i.e. Outbound Access Token.
2828
*
2929
* @remarks
30-
* This method is imeplemented only for {@link DefaultConfig.REGIONAL_API_HOST}
30+
* This method is implemented only for {@link DefaultConfig.REGIONAL_API_HOST}
3131
* and requires {@link TenantConfig} to be configured in the {@link Auth} instance used.
3232
*
3333
* Fails with an error if the token is invalid, expired, or not accepted by the Firebase Auth service.

0 commit comments

Comments
 (0)