Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/connect-react/src/contexts/SharedProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const SharedProvider: FC<PropsWithChildren<Props>> = ({ children, connect
config.projectId,
config.frontendApiUrlSuffix ?? 'frontendapi.corbado.io',
config.isDebug ?? false,
config.customDomain,
),
);

Expand Down
1 change: 1 addition & 0 deletions packages/connect-web-js/src/models/CorbadoState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export class CorbadoState {
connectConfig.projectId,
connectConfig.frontendApiUrlSuffix ?? 'frontendapi.corbado.io',
connectConfig.isDebug ?? false,
connectConfig.customDomain,
);

this.#connectConfig = connectConfig;
Expand Down
1 change: 1 addition & 0 deletions packages/types/src/connect/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export type CorbadoConnectConfig = {
frontendApiUrlSuffix?: string;
isDebug?: boolean;
enableHighlight?: boolean;
customDomain?: string;
};

export type CorbadoConnectDemoConfig = {
Expand Down
8 changes: 6 additions & 2 deletions packages/web-core/src/services/ConnectService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,14 @@ export class ConnectService {
#projectId: string;
#timeout: number;
readonly #frontendApiUrlSuffix: string;
readonly #customDomain: string | undefined;
#visitorId: string;

constructor(projectId: string, frontendApiUrlSuffix: string, isDebug: boolean) {
constructor(projectId: string, frontendApiUrlSuffix: string, isDebug: boolean, customDomain?: string) {
this.#projectId = projectId;
this.#timeout = 10 * 1000;
this.#frontendApiUrlSuffix = frontendApiUrlSuffix;
this.#customDomain = customDomain;
this.#webAuthnService = new WebAuthnService();
this.#visitorId = '';

Expand Down Expand Up @@ -129,7 +131,9 @@ export class ConnectService {

#setApisV2(process?: ConnectProcess): void {
let frontendApiUrl = this.#getDefaultFrontendApiUrl();
if (process?.frontendApiUrl && process?.frontendApiUrl.length > 0) {
if (this.#customDomain && this.#customDomain.length > 0) {
frontendApiUrl = this.#customDomain;
} else if (process?.frontendApiUrl && process?.frontendApiUrl.length > 0) {
frontendApiUrl = process.frontendApiUrl;
}

Expand Down
Loading