From a80319045b688a35ada4fdb8bc3af3284e1d7af3 Mon Sep 17 00:00:00 2001 From: "Ben Scholzen (DASPRiD)" Date: Thu, 7 Mar 2024 13:10:28 +0100 Subject: [PATCH] fix(skeleton): connect clients to connection --- skeleton/templates/src/auth0-stack.ts.mustache | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/skeleton/templates/src/auth0-stack.ts.mustache b/skeleton/templates/src/auth0-stack.ts.mustache index 82cc2f1..4929e7a 100644 --- a/skeleton/templates/src/auth0-stack.ts.mustache +++ b/skeleton/templates/src/auth0-stack.ts.mustache @@ -40,7 +40,7 @@ class Auth0Stack extends TerraformStack { supportUrl: "{{{tenant.supportUrl}}}", }); - new Connection(this, "UsernamePasswordAuthenticationConnection", { + {{#if spa}}const connection = {{/if}}new Connection(this, "UsernamePasswordAuthenticationConnection", { name: "Username-Password-Authentication", strategy: "auth0", options: { @@ -74,7 +74,7 @@ class Auth0Stack extends TerraformStack { {{/if}} {{#if spa}} - new Client(this, "{{{spa.resourceName}}}", { + const {{{spa.propPrefix}}} = new Client(this, "{{{spa.resourceName}}}", { name: "{{{spa.name}}}", appType: "spa", isFirstParty: true, @@ -86,6 +86,11 @@ class Auth0Stack extends TerraformStack { tokenLifetime: 60 * 60 * 24 * 30, idleTokenLifetime: 60 * 60 * 24 * 15 }, + initiateLoginUri: + props.sbiCustomerPortalBaseUrl.startsWith("https://") && + !props.sbiCustomerPortalBaseUrl.startsWith("https://localhost") + ? ${props.sbiCustomerPortalBaseUrl} + : undefined, callbacks: [props.{{{spa.propPrefix}}}BaseUrl], allowedOrigins: [props.{{{spa.propPrefix}}}BaseUrl], allowedLogoutUrls: [props.{{{spa.propPrefix}}}BaseUrl], @@ -96,6 +101,11 @@ class Auth0Stack extends TerraformStack { ], }); + new ConnectionClients(this, "UsernamePasswordAuthenticationConnectionClients", { + connectionId: connection.id, + enabledClients: [{{{spa.propPrefix}}}.id], + }); + {{/if}} if (props.ses) { new EmailProvider(this, "EmailProvider", {