Skip to content

Commit 17c9007

Browse files
committed
fix: custom domain with http prefix
1 parent 573dae7 commit 17c9007

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/utils/isCustomDomain.test.ts

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ describe("isCustomDomain", () => {
66
const result = isCustomDomain("www.test.com");
77
expect(result).toEqual(true);
88
});
9+
it("protocol-prefixed kinde domain is not a custom domain", () => {
10+
const result = isCustomDomain("https://test.kinde.com");
11+
expect(result).toEqual(false);
12+
});
913
it("custom domain not in use", () => {
1014
const result = isCustomDomain("test.kinde.com");
1115
expect(result).toEqual(false);

lib/utils/isCustomDomain.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
export const isCustomDomain = (domain: string): boolean => {
2-
return !domain.match("^[a-zA-Z]*.kinde.com");
2+
return !domain.match(
3+
/^(?:https?:\/\/)?[a-zA-Z0-9][-a-zA-Z0-9]*\.kinde\.com$/i,
4+
);
35
};

0 commit comments

Comments
 (0)