Skip to content

Commit 295b414

Browse files
committed
fix(clerk-react): Add buildAfterSignInUrl & buildAfterSignUpUrl
1 parent a569abc commit 295b414

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

packages/react/src/isomorphicClerk.ts

+22-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,10 @@ type IsomorphicLoadedClerk = Without<
113113
buildOrganizationProfileUrl: () => string | void;
114114
// TODO: Align return type
115115
buildUrlWithAuth: (to: string, opts?: BuildUrlWithAuthParams | undefined) => string | void;
116-
116+
// TODO: Align return type
117+
buildAfterSignInUrl: () => string | void;
118+
// TODO: Align return type
119+
buildAfterSignUpUrl: () => string | void;
117120
// TODO: Align optional props
118121
mountUserButton: (node: HTMLDivElement, props: UserButtonProps) => void;
119122
mountOrganizationList: (node: HTMLDivElement, props: OrganizationListProps) => void;
@@ -259,6 +262,24 @@ export class IsomorphicClerk implements IsomorphicLoadedClerk {
259262
}
260263
};
261264

265+
buildAfterSignInUrl = (): string | void => {
266+
const callback = () => this.clerkjs?.buildAfterSignInUrl() || '';
267+
if (this.clerkjs && this.#loaded) {
268+
return callback();
269+
} else {
270+
this.premountMethodCalls.set('buildAfterSignInUrl', callback);
271+
}
272+
};
273+
274+
buildAfterSignUpUrl = (): string | void => {
275+
const callback = () => this.clerkjs?.buildAfterSignUpUrl() || '';
276+
if (this.clerkjs && this.#loaded) {
277+
return callback();
278+
} else {
279+
this.premountMethodCalls.set('buildAfterSignUpUrl', callback);
280+
}
281+
};
282+
262283
buildUserProfileUrl = (): string | void => {
263284
const callback = () => this.clerkjs?.buildUserProfileUrl() || '';
264285
if (this.clerkjs && this.#loaded) {

0 commit comments

Comments
 (0)