Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ This can be done by renaming `auth_config.json.example` (https://github.com/auth
"domain": "YOUR_DOMAIN",
"clientId": "YOUR_CLIENT_ID",
"authorizationParams": {
"audience": "YOUR_API_IDENTIFIER",
"audience": "{yourApiIdentifier}",
},
"apiUri": "http://localhost:3001",
"appUri": "http://localhost:4200"
Expand Down
6 changes: 4 additions & 2 deletions Sample-01/api-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ const app = express();
if (
!authConfig.domain ||
!authConfig.authorizationParams.audience ||
["YOUR_API_IDENTIFIER", "{API_IDENTIFIER}"].includes(authConfig.authorizationParams.audience)
['{yourApiIdentifier}', '{API_IDENTIFIER}'].includes(
authConfig.authorizationParams.audience
)
) {
console.log(
"Exiting: Please make sure that auth_config.json is in place and populated with valid domain and audience values"
'Exiting: Please make sure that auth_config.json is in place and populated with valid domain and audience values'
);

process.exit();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="container mt-5">
<h1>External API</h1>

<div *ngIf="hasApiError" class="alert alert-danger" role="alert">
An error occured when trying to call the local API on port 3001. Ensure the local API is started using either `npm run dev` or `npm run
server:api`.
Expand All @@ -20,7 +20,7 @@ <h1>External API</h1>
<p>
You can't call the API at the moment because your application does not
have any configuration for <code>audience</code>, or it is using the
default value of <code>YOUR_API_IDENTIFIER</code>. You might get this
default value of <code>&#123;yourApiIdentifier&#125;</code>. You might get this
default value if you used the "Download Sample" feature of
<a href="https://auth0.com/docs/quickstart/spa/angular">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I had to use the HTML characters for {}, as it was considering the brackets as JSX and causing the tests to fail.

the quickstart guide </a
Expand Down
2 changes: 1 addition & 1 deletion Sample-01/src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const environment = {
auth: {
domain,
clientId,
...(audience && audience !== "YOUR_API_IDENTIFIER" ? { audience } : null),
...(audience && audience !== "{yourApiIdentifier}" ? { audience } : null),
redirectUri: window.location.origin,
errorPath,
},
Expand Down
2 changes: 1 addition & 1 deletion Sample-01/src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const environment = {
domain,
clientId,
authorizationParams: {
...(audience && audience !== 'YOUR_API_IDENTIFIER' ? { audience } : null),
...(audience && audience !== '{yourApiIdentifier}' ? { audience } : null),
redirect_uri: window.location.origin,
},
errorPath,
Expand Down
6 changes: 4 additions & 2 deletions Standalone/api-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ const app = express();
if (
!authConfig.domain ||
!authConfig.authorizationParams.audience ||
["YOUR_API_IDENTIFIER", "{API_IDENTIFIER}"].includes(authConfig.authorizationParams.audience)
['{yourApiIdentifier}', '{API_IDENTIFIER}'].includes(
authConfig.authorizationParams.audience
)
) {
console.log(
"Exiting: Please make sure that auth_config.json is in place and populated with valid domain and audience values"
'Exiting: Please make sure that auth_config.json is in place and populated with valid domain and audience values'
);

process.exit();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="container mt-5">
<h1>External API</h1>

<div *ngIf="hasApiError" class="alert alert-danger" role="alert">
An error occured when trying to call the local API on port 3001. Ensure the local API is started using either `npm run dev` or `npm run
server:api`.
Expand All @@ -20,7 +20,7 @@ <h1>External API</h1>
<p>
You can't call the API at the moment because your application does not
have any configuration for <code>audience</code>, or it is using the
default value of <code>YOUR_API_IDENTIFIER</code>. You might get this
default value of <code>&#123;yourApiIdentifier&#125;</code>. You might get this
default value if you used the "Download Sample" feature of
<a href="https://auth0.com/docs/quickstart/spa/angular">
the quickstart guide </a
Expand Down
2 changes: 1 addition & 1 deletion Standalone/src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const environment = {
auth: {
domain,
clientId,
...(audience && audience !== "YOUR_API_IDENTIFIER" ? { audience } : null),
...(audience && audience !== "{yourApiIdentifier}" ? { audience } : null),
redirectUri: window.location.origin,
errorPath,
},
Expand Down
2 changes: 1 addition & 1 deletion Standalone/src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const environment = {
domain,
clientId,
authorizationParams: {
...(audience && audience !== 'YOUR_API_IDENTIFIER' ? { audience } : null),
...(audience && audience !== '{yourApiIdentifier}' ? { audience } : null),
redirect_uri: window.location.origin,
},
errorPath,
Expand Down