File tree 4 files changed +9
-12
lines changed
4 files changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ const appOrigin = authConfig.appOrigin || `http://localhost:${appPort}`;
14
14
if (
15
15
! authConfig . domain ||
16
16
! authConfig . audience ||
17
- authConfig . audience === "YOUR_API_IDENTIFIER"
17
+ [ "{yourApiIdentifier}" , "{API_IDENTIFIER}" ] . includes ( authConfig . audience )
18
18
) {
19
19
console . log (
20
20
"Exiting: Please make sure that auth_config.json is in place and populated with valid domain and audience values"
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ describe("The config module", () => {
27
27
} ) ;
28
28
29
29
it ( "should omit the audience if left at a default value" , ( ) => {
30
- mockConfig ( { audience : "YOUR_API_IDENTIFIER " } ) ;
30
+ mockConfig ( { audience : "{yourApiIdentifier} " } ) ;
31
31
32
32
const { getConfig } = require ( "../config" ) ;
33
33
Original file line number Diff line number Diff line change @@ -2,13 +2,13 @@ import configJson from "./auth_config.json";
2
2
3
3
export function getConfig ( ) {
4
4
// Configure the audience here. By default, it will take whatever is in the config
5
- // (specified by the `audience` key) unless it's the default value of "YOUR_API_IDENTIFIER " (which
5
+ // (specified by the `audience` key) unless it's the default value of "{yourApiIdentifier} " (which
6
6
// is what you get sometimes by using the Auth0 sample download tool from the quickstart page, if you
7
7
// don't have an API).
8
8
// If this resolves to `null`, the API page changes to show some helpful info about what to do
9
9
// with the audience.
10
10
const audience =
11
- configJson . audience && configJson . audience !== "YOUR_API_IDENTIFIER "
11
+ configJson . audience && configJson . audience !== "{yourApiIdentifier} "
12
12
? configJson . audience
13
13
: null ;
14
14
Original file line number Diff line number Diff line change @@ -14,11 +14,8 @@ export const ExternalApiComponent = () => {
14
14
error : null ,
15
15
} ) ;
16
16
17
- const {
18
- getAccessTokenSilently,
19
- loginWithPopup,
20
- getAccessTokenWithPopup,
21
- } = useAuth0 ( ) ;
17
+ const { getAccessTokenSilently, loginWithPopup, getAccessTokenWithPopup } =
18
+ useAuth0 ( ) ;
22
19
23
20
const handleConsent = async ( ) => {
24
21
try {
@@ -130,9 +127,9 @@ export const ExternalApiComponent = () => {
130
127
< p >
131
128
You can't call the API at the moment because your application does
132
129
not have any configuration for < code > audience</ code > , or it is
133
- using the default value of < code > YOUR_API_IDENTIFIER </ code > . You
134
- might get this default value if you used the "Download Sample"
135
- feature of{ " " }
130
+ using the default value of{ " " }
131
+ < code > {yourApiIdentifier} </ code > . You might get this
132
+ default value if you used the "Download Sample" feature of{ " " }
136
133
< a href = "https://auth0.com/docs/quickstart/spa/react" >
137
134
the quickstart guide
138
135
</ a >
You can’t perform that action at this time.
0 commit comments