Skip to content

Commit

Permalink
🚸 When a user signs up they're directly logged in (#952)
Browse files Browse the repository at this point in the history
* 🚸 When a user signs up they're directly logged in

* lint

---------

Co-authored-by: coyotte508 <[email protected]>
Co-authored-by: Nathan Sarrazin <[email protected]>
  • Loading branch information
3 people committed Mar 22, 2024
1 parent 5f64024 commit 506e596
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/routes/login/callback/updateUser.ts
Expand Up @@ -92,9 +92,6 @@ export async function updateUser(params: {
ip,
expiresAt: addWeeks(new Date(), 2),
});

// refresh session cookie
refreshSessionCookie(cookies, secretSessionId);
} else {
// user doesn't exist yet, create a new one
const { insertedId } = await collections.users.insertOne({
Expand Down Expand Up @@ -142,6 +139,9 @@ export async function updateUser(params: {
}
}

// refresh session cookie
refreshSessionCookie(cookies, secretSessionId);

// migrate pre-existing conversations
await collections.conversations.updateMany(
{ sessionId: previousSessionId },
Expand Down

0 comments on commit 506e596

Please sign in to comment.