Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
azaylamba committed Jul 18, 2024
2 parents 61b73d2 + efa9fa8 commit feb5752
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/user-interface/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,17 @@ export class UserInterface extends Construct {
let websocketEndpoint: string;
let distribution;
let publishedDomain: string;

let redirectSignIn: string;

if (props.config.privateWebsite) {
const privateWebsite = new PrivateWebsite(this, "PrivateWebsite", {...props, websiteBucket: websiteBucket });
this.publishedDomain = props.config.domain? props.config.domain : "";
redirectSignIn = `https://${this.publishedDomain}/index.html`
} else {
const publicWebsite = new PublicWebsite(this, "PublicWebsite", {...props, websiteBucket: websiteBucket });
distribution = publicWebsite.distribution
this.publishedDomain = distribution.distributionDomainName;
redirectSignIn = `https://${this.publishedDomain}`
}

const exportsAsset = s3deploy.Source.jsonData("aws-exports.json", {
Expand All @@ -89,7 +92,7 @@ export class UserInterface extends Construct {
oauth: props.config.cognitoFederation?.enabled
? {
domain: `${props.config.cognitoFederation.cognitoDomain}.auth.${cdk.Aws.REGION}.amazoncognito.com`,
redirectSignIn: `https://${this.publishedDomain}`,
redirectSignIn: redirectSignIn,
redirectSignOut: `https://${this.publishedDomain}`,
Scopes: ["email","openid"],
responseType: "code",
Expand Down

0 comments on commit feb5752

Please sign in to comment.