fix: Email auth should allow same guest user on multiple subdomains (#2252)

* test: Add email auth tests to establish current state of system

* fix: Update logic to account for dupe emails used between subdomains

* test

* test
This commit is contained in:
Tom Moor
2021-07-02 12:07:43 -07:00
committed by GitHub
parent 2ae74f2834
commit 1c0c694c22
5 changed files with 218 additions and 26 deletions

View File

@ -68,6 +68,23 @@ export function buildEvent(overrides: Object = {}) {
});
}
export async function buildGuestUser(overrides: Object = {}) {
if (!overrides.teamId) {
const team = await buildTeam();
overrides.teamId = team.id;
}
count++;
return User.create({
email: `user${count}@example.com`,
name: `User ${count}`,
createdAt: new Date("2018-01-01T00:00:00.000Z"),
lastActiveAt: new Date("2018-01-01T00:00:00.000Z"),
...overrides,
});
}
export async function buildUser(overrides: Object = {}) {
if (!overrides.teamId) {
const team = await buildTeam();