Skip to content

Commit

Permalink
Update password-reset.md (#1504)
Browse files Browse the repository at this point in the history
  • Loading branch information
rwieruch authored Mar 22, 2024
1 parent ea98e37 commit 14fd0a5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/pages/guides/email-and-password/password-reset.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,13 @@ app.post("/reset-password/:token", async () => {
});
}

await lucia.invalidateUserSessions(user.id);
await lucia.invalidateUserSessions(token.user_id);
const hashedPassword = await new Argon2id().hash(password);
await db.table("user").where("id", "=", user.id).update({
await db.table("user").where("id", "=", token.user_id).update({
hashed_password: hashedPassword
});

const session = await lucia.createSession(user.id, {});
const session = await lucia.createSession(token.user_id, {});
const sessionCookie = lucia.createSessionCookie(session.id);
return new Response(null, {
status: 302,
Expand Down

0 comments on commit 14fd0a5

Please sign in to comment.