File tree Expand file tree Collapse file tree 5 files changed +15
-10
lines changed Expand file tree Collapse file tree 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', () => {
4747 const { projectId, appId, apiKey } = app . options ;
4848
4949 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 } ` ,
5151 body : {
5252 // eslint-disable-next-line camelcase
53- recaptcha_token : 'fake-recaptcha-token'
53+ recaptcha_v3_token : 'fake-recaptcha-token'
5454 }
5555 } ) ;
5656 } ) ;
@@ -78,7 +78,7 @@ describe('client', () => {
7878 Promise . resolve ( {
7979 status : 200 ,
8080 json : async ( ) => ( {
81- attestationToken : 'fake-appcheck-token' ,
81+ token : 'fake-appcheck-token' ,
8282 ttl : '3.600s'
8383 } )
8484 } as Response )
@@ -189,7 +189,7 @@ describe('client', () => {
189189 status : 200 ,
190190 json : ( ) =>
191191 Promise . resolve ( {
192- attestationToken : 'fake-appcheck-token' ,
192+ token : 'fake-appcheck-token' ,
193193 ttl : 'NAN'
194194 } )
195195 } as Response )
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ import { AppCheckTokenInternal } from './types';
3030 * Response JSON returned from AppCheck server endpoint.
3131 */
3232interface AppCheckResponse {
33- attestationToken : string ;
33+ token : string ;
3434 // timeToLive
3535 ttl : string ;
3636}
@@ -101,7 +101,7 @@ export async function exchangeToken(
101101
102102 const now = Date . now ( ) ;
103103 return {
104- token : responseBody . attestationToken ,
104+ token : responseBody . token ,
105105 expireTimeMillis : now + timeToLiveAsNumber ,
106106 issuedAtTimeMillis : now
107107 } ;
@@ -116,7 +116,7 @@ export function getExchangeRecaptchaV3TokenRequest(
116116 return {
117117 url : `${ BASE_ENDPOINT } /projects/${ projectId } /apps/${ appId } :${ EXCHANGE_RECAPTCHA_TOKEN_METHOD } ?key=${ apiKey } ` ,
118118 body : {
119- 'recaptcha_token ' : reCAPTCHAToken
119+ 'recaptcha_v3_token ' : reCAPTCHAToken
120120 }
121121 } ;
122122}
Original file line number Diff line number Diff line change 1515 * limitations under the License.
1616 */
1717export const BASE_ENDPOINT =
18- 'https://content-firebaseappcheck.googleapis.com/v1beta ' ;
18+ 'https://content-firebaseappcheck.googleapis.com/v1 ' ;
1919
20- export const EXCHANGE_RECAPTCHA_TOKEN_METHOD = 'exchangeRecaptchaToken ' ;
20+ export const EXCHANGE_RECAPTCHA_TOKEN_METHOD = 'exchangeRecaptchaV3Token ' ;
2121export const EXCHANGE_RECAPTCHA_ENTERPRISE_TOKEN_METHOD =
2222 'exchangeRecaptchaEnterpriseToken' ;
2323export const EXCHANGE_DEBUG_TOKEN_METHOD = 'exchangeDebugToken' ;
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ describe('internal api', () => {
111111
112112 expect ( reCAPTCHASpy ) . to . be . called ;
113113
114- expect ( exchangeTokenStub . args [ 0 ] [ 0 ] . body [ 'recaptcha_token ' ] ) . to . equal (
114+ expect ( exchangeTokenStub . args [ 0 ] [ 0 ] . body [ 'recaptcha_v3_token ' ] ) . to . equal (
115115 fakeRecaptchaToken
116116 ) ;
117117 expect ( token ) . to . deep . equal ( { token : fakeRecaptchaAppCheckToken . token } ) ;
You can’t perform that action at this time.
0 commit comments