Feat: add auth provider to users on sign in (#3739)

* feat: merge a new authentication method onto existing user records when emails match

* adds test for invite acceptance and auth provider creation

* addresses comments
- test existing user and invites in different test cases
- update lastActiveAt syncronously when an invite is accepted

* sort arrays in test to prevent nondeterministic test behaivior when doing array compare
This commit is contained in:
Nan Yu
2022-07-08 00:24:46 -07:00
committed by GitHub
parent ec8c0645ba
commit 1e808fc52c
4 changed files with 125 additions and 37 deletions

View File

@@ -179,6 +179,7 @@ export async function buildInvite(overrides: Partial<User> = {}) {
name: `User ${count}`,
createdAt: new Date("2018-01-01T00:00:00.000Z"),
invitedById: actor.id,
authentications: [],
...overrides,
lastActiveAt: null,
});