[go: nahoru, domu]

Skip to content

Commit

Permalink
Show isTokenAutoRefreshEnabled in App Check (firebase#208)
Browse files Browse the repository at this point in the history
* Show isTokenAutoRefreshEnabled in App Check

* npm run snippets
  • Loading branch information
kevinthecheung committed Jul 28, 2021
1 parent da7abdb commit 74b104c
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 6 deletions.
12 changes: 10 additions & 2 deletions appcheck-next/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ function initialize() {
// Pass your reCAPTCHA v3 site key (public key) to activate(). Make sure this
// key is the counterpart to the secret key you set in the Firebase console.
const appCheck = initializeAppCheck(app, {
provider: new ReCaptchaV3Provider('abcdefghijklmnopqrstuvwxy-1234567890abcd')
provider: new ReCaptchaV3Provider('abcdefghijklmnopqrstuvwxy-1234567890abcd'),

// Optional argument. If true, the SDK automatically refreshes App Check
// tokens as needed.
isTokenAutoRefreshEnabled: true
});
// [END appcheck_initialize]
}
Expand Down Expand Up @@ -59,7 +63,11 @@ function initializeCustomProvider() {
});

const appCheck = initializeAppCheck(app, {
provider: appCheckCustomProvider
provider: appCheckCustomProvider,

// Optional argument. If true, the SDK automatically refreshes App Check
// tokens as needed.
isTokenAutoRefreshEnabled: true
});
// [END appcheck_initialize_custom_provider]
}
Expand Down
14 changes: 12 additions & 2 deletions appcheck/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ function initialize() {
const appCheck = firebase.appCheck();
// Pass your reCAPTCHA v3 site key (public key) to activate(). Make sure this
// key is the counterpart to the secret key you set in the Firebase console.
appCheck.activate('abcdefghijklmnopqrstuvwxy-1234567890abcd');
appCheck.activate(
'abcdefghijklmnopqrstuvwxy-1234567890abcd',

// Optional argument. If true, the SDK automatically refreshes App Check
// tokens as needed.
true);
// [END appcheck_initialize]
}

Expand Down Expand Up @@ -50,7 +55,12 @@ function initializeCustomProvider() {
});

const appCheck = firebase.appCheck();
appCheck.activate(appCheckCustomProvider);
appCheck.activate(
appCheckCustomProvider,

// Optional argument. If true, the SDK automatically refreshes App Check
// tokens as needed.
true);
// [END appcheck_initialize_custom_provider]
}

Expand Down
6 changes: 5 additions & 1 deletion snippets/appcheck-next/index/appcheck_initialize.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ const app = initializeApp({
// Pass your reCAPTCHA v3 site key (public key) to activate(). Make sure this
// key is the counterpart to the secret key you set in the Firebase console.
const appCheck = initializeAppCheck(app, {
provider: new ReCaptchaV3Provider('abcdefghijklmnopqrstuvwxy-1234567890abcd')
provider: new ReCaptchaV3Provider('abcdefghijklmnopqrstuvwxy-1234567890abcd'),

// Optional argument. If true, the SDK automatically refreshes App Check
// tokens as needed.
isTokenAutoRefreshEnabled: true
});
// [END appcheck_initialize_modular]
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ const app = initializeApp({
});

const appCheck = initializeAppCheck(app, {
provider: appCheckCustomProvider
provider: appCheckCustomProvider,

// Optional argument. If true, the SDK automatically refreshes App Check
// tokens as needed.
isTokenAutoRefreshEnabled: true
});
// [END appcheck_initialize_custom_provider_modular]

0 comments on commit 74b104c

Please sign in to comment.