Skip to content

Commit

Permalink
fix(skeleton): connect clients to connection
Browse files Browse the repository at this point in the history
  • Loading branch information
DASPRiD committed Mar 7, 2024
1 parent a3cad76 commit a803190
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions skeleton/templates/src/auth0-stack.ts.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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,
Expand All @@ -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],
Expand All @@ -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", {
Expand Down

0 comments on commit a803190

Please sign in to comment.