An order of operations oversight in terms of needing a route to not 404 before/during the registration rather than setting it up after
This commit is contained in:
parent
eb662a603d
commit
6ab565449a
1 changed files with 4 additions and 0 deletions
|
|
@ -142,6 +142,9 @@ export class OAuthApp extends App {
|
||||||
|
|
||||||
console.log(`Attempting to create/register the app:\n\tApp Base URL: ${baseAppUrl}\n\tApp Abbreviation: ${appAbbrv}\n\tApp Name: ${typeof this.appName === 'undefined' ? 'uses APP_NAME environment variable (' + process.env.APP_NAME + ')' : this.appName}\n\tScopes: ${typeof this.scopes === 'undefined' ? 'uses SCOPES environment variable (' + process.env.SCOPES + ')' : this.scopes.join(', ')}`);
|
console.log(`Attempting to create/register the app:\n\tApp Base URL: ${baseAppUrl}\n\tApp Abbreviation: ${appAbbrv}\n\tApp Name: ${typeof this.appName === 'undefined' ? 'uses APP_NAME environment variable (' + process.env.APP_NAME + ')' : this.appName}\n\tScopes: ${typeof this.scopes === 'undefined' ? 'uses SCOPES environment variable (' + process.env.SCOPES + ')' : this.scopes.join(', ')}`);
|
||||||
|
|
||||||
|
// Because we need this for registration to work properly. It make sense to put it here
|
||||||
|
app.getInitializer().getRouter().addOutsideFrameworkRoute('/.well-known/jwks.json');
|
||||||
|
|
||||||
const client = await Client.setup(app.getExpressApp(), baseAppUrl, this.onAuth, this.saveSecret, appAbbrv, this.appName, this.scopes, {
|
const client = await Client.setup(app.getExpressApp(), baseAppUrl, this.onAuth, this.saveSecret, appAbbrv, this.appName, this.scopes, {
|
||||||
contacts: this.contacts,
|
contacts: this.contacts,
|
||||||
logo_url: this.logo_url,
|
logo_url: this.logo_url,
|
||||||
|
|
@ -155,6 +158,7 @@ export class OAuthApp extends App {
|
||||||
});
|
});
|
||||||
|
|
||||||
client.getSetupRoutes().forEach((route) => {
|
client.getSetupRoutes().forEach((route) => {
|
||||||
|
console.log(`Adding outside framework route: ${route}`);
|
||||||
app.getInitializer().getRouter().addOutsideFrameworkRoute(route);
|
app.getInitializer().getRouter().addOutsideFrameworkRoute(route);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue