File tree 5 files changed +15
-10
lines changed
5 files changed +15
-10
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @firebase/app-check ' : patch
3
+ ---
4
+
5
+ Update App Check to use v1 endpoint instead of v1beta endpoint for both reCAPTCHA v3 and reCAPTCHA Enterprise
Original file line number Diff line number Diff line change @@ -47,10 +47,10 @@ describe('client', () => {
47
47
const { projectId, appId, apiKey } = app . options ;
48
48
49
49
expect ( request ) . to . deep . equal ( {
50
- url : `${ BASE_ENDPOINT } /projects/${ projectId } /apps/${ appId } :exchangeRecaptchaToken ?key=${ apiKey } ` ,
50
+ url : `${ BASE_ENDPOINT } /projects/${ projectId } /apps/${ appId } :exchangeRecaptchaV3Token ?key=${ apiKey } ` ,
51
51
body : {
52
52
// eslint-disable-next-line camelcase
53
- recaptcha_token : 'fake-recaptcha-token'
53
+ recaptcha_v3_token : 'fake-recaptcha-token'
54
54
}
55
55
} ) ;
56
56
} ) ;
@@ -78,7 +78,7 @@ describe('client', () => {
78
78
Promise . resolve ( {
79
79
status : 200 ,
80
80
json : async ( ) => ( {
81
- attestationToken : 'fake-appcheck-token' ,
81
+ token : 'fake-appcheck-token' ,
82
82
ttl : '3.600s'
83
83
} )
84
84
} as Response )
@@ -189,7 +189,7 @@ describe('client', () => {
189
189
status : 200 ,
190
190
json : ( ) =>
191
191
Promise . resolve ( {
192
- attestationToken : 'fake-appcheck-token' ,
192
+ token : 'fake-appcheck-token' ,
193
193
ttl : 'NAN'
194
194
} )
195
195
} as Response )
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ import { AppCheckTokenInternal } from './types';
30
30
* Response JSON returned from AppCheck server endpoint.
31
31
*/
32
32
interface AppCheckResponse {
33
- attestationToken : string ;
33
+ token : string ;
34
34
// timeToLive
35
35
ttl : string ;
36
36
}
@@ -101,7 +101,7 @@ export async function exchangeToken(
101
101
102
102
const now = Date . now ( ) ;
103
103
return {
104
- token : responseBody . attestationToken ,
104
+ token : responseBody . token ,
105
105
expireTimeMillis : now + timeToLiveAsNumber ,
106
106
issuedAtTimeMillis : now
107
107
} ;
@@ -116,7 +116,7 @@ export function getExchangeRecaptchaV3TokenRequest(
116
116
return {
117
117
url : `${ BASE_ENDPOINT } /projects/${ projectId } /apps/${ appId } :${ EXCHANGE_RECAPTCHA_TOKEN_METHOD } ?key=${ apiKey } ` ,
118
118
body : {
119
- 'recaptcha_token ' : reCAPTCHAToken
119
+ 'recaptcha_v3_token ' : reCAPTCHAToken
120
120
}
121
121
} ;
122
122
}
Original file line number Diff line number Diff line change 15
15
* limitations under the License.
16
16
*/
17
17
export const BASE_ENDPOINT =
18
- 'https://content-firebaseappcheck.googleapis.com/v1beta ' ;
18
+ 'https://content-firebaseappcheck.googleapis.com/v1 ' ;
19
19
20
- export const EXCHANGE_RECAPTCHA_TOKEN_METHOD = 'exchangeRecaptchaToken ' ;
20
+ export const EXCHANGE_RECAPTCHA_TOKEN_METHOD = 'exchangeRecaptchaV3Token ' ;
21
21
export const EXCHANGE_RECAPTCHA_ENTERPRISE_TOKEN_METHOD =
22
22
'exchangeRecaptchaEnterpriseToken' ;
23
23
export const EXCHANGE_DEBUG_TOKEN_METHOD = 'exchangeDebugToken' ;
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ describe('internal api', () => {
111
111
112
112
expect ( reCAPTCHASpy ) . to . be . called ;
113
113
114
- expect ( exchangeTokenStub . args [ 0 ] [ 0 ] . body [ 'recaptcha_token ' ] ) . to . equal (
114
+ expect ( exchangeTokenStub . args [ 0 ] [ 0 ] . body [ 'recaptcha_v3_token ' ] ) . to . equal (
115
115
fakeRecaptchaToken
116
116
) ;
117
117
expect ( token ) . to . deep . equal ( { token : fakeRecaptchaAppCheckToken . token } ) ;
You can’t perform that action at this time.
0 commit comments