🚸 When a user signs up they're directly logged in (#952)

* 🚸 When a user signs up they're directly logged in

* lint

---------

Co-authored-by: coyotte508 <coyotte508@protonmail.com>
Co-authored-by: Nathan Sarrazin <sarrazin.nathan@gmail.com>
pull/954/head
Eliott C 2024-03-22 16:22:41 +01:00 committed by GitHub
parent 5f6402409f
commit 506e596feb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -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({
@ -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 },