feat: allow personal gmail accounts to be used to sign into teams with an existing invite (#3652)

* feat: allow personal gmail accounts to be used to sign into teams with an existing invite

* address comments

* add comment for appDomain

* address comments
This commit is contained in:
Nan Yu
2022-06-20 01:33:16 -07:00
committed by GitHub
parent 188c1e409b
commit e0d2b6cace
6 changed files with 158 additions and 56 deletions

View File

@@ -42,6 +42,13 @@ describe("#parseDomain", () => {
});
});
it("should return the same result when parsing the returned host", () => {
const customDomain = parseDomain("www.example.com");
const subDomain = parseDomain("myteam.example.com");
expect(parseDomain(customDomain.host)).toMatchObject(customDomain);
expect(parseDomain(subDomain.host)).toMatchObject(subDomain);
});
it("should remove the path", () => {
expect(parseDomain("example.com/some/path?and&query")).toMatchObject({
teamSubdomain: "",

View File

@@ -49,7 +49,7 @@ export function changelogUrl(): string {
}
export function signin(service = "slack"): string {
return `${env.URL}/auth/${service}`;
return `/auth/${service}`;
}
export const SLUG_URL_REGEX = /^(?:[0-9a-zA-Z-_~]*-)?([a-zA-Z0-9]{10,15})$/;