Skip to content

Conversation

@mchang16-auth
Copy link
Contributor

@mchang16-auth mchang16-auth commented Mar 19, 2025

Background

Currently, this line in api-server.js is:

 ['{yourApiIdentifier}', '{API_IDENTIFIER}'].includes(
    authConfig.authorizationParams.audience
  )

But when the Angular sample app is downloaded from the Quickstarts (both Dashboard and from auth0.com/docs) and the user does not have an API created, this line in api-server.js becomes:

['{yourApiIdentifier}', '{yourApiIdentifier}'].includes(
    authConfig.authorizationParams.audience

This is because '{API_IDENTIFIER}' is being replaced with '{yourApiIdentifier}' when downloaded as a sample app.
Note: this was happening even prior to the changes made in #524, so that PR did not create this text replacing.

Changes

In this PR, we changed ['{yourApiIdentifier}', '{API_IDENTIFIER}'] to authConfig.authorizationParams.audience === '{API_IDENTIFIER}' to remove this duplicated string from happening. This way, it still satisfies both use cases:

  • '{API_IDENTIFIER}' is used when a user downloads the sample app straight from Github
  • '{yourApiIdentifier}' is used when a user downloads the sample app from a Quickstart

@mchang16-auth mchang16-auth marked this pull request as ready for review March 19, 2025 16:20
@mchang16-auth mchang16-auth merged commit 9591c29 into auth0-samples:main Mar 20, 2025
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants