@syncello/auth 3.4.0 → 3.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3717,7 +3717,7 @@ var resetPasswordRoute = createRoute7({
3717
3717
  });
3718
3718
  var resetPasswordHandler = async (c) => {
3719
3719
  const { token, password, turnstileToken } = c.req.valid("json");
3720
- const database = c.get("db");
3720
+ const { db: database, schema } = getAuthContext(c);
3721
3721
  const env = c.env;
3722
3722
  const turnstileValid = await verifyTurnstileToken(
3723
3723
  turnstileToken,
@@ -3732,7 +3732,18 @@ var resetPasswordHandler = async (c) => {
3732
3732
  if (!passwordValidation.valid) {
3733
3733
  return problems.badRequest(c, passwordValidation.error || "Invalid password");
3734
3734
  }
3735
- const result = await resetPassword(database, token, password, env.PASSWORD_PEPPER_V1, "v1");
3735
+ const result = await resetPassword(
3736
+ database,
3737
+ {
3738
+ users: schema.users,
3739
+ passwordResetTokens: schema.passwordResetTokens,
3740
+ sessions: schema.sessions
3741
+ },
3742
+ token,
3743
+ password,
3744
+ env.PASSWORD_PEPPER_V1,
3745
+ "v1"
3746
+ );
3736
3747
  if (!result.success) {
3737
3748
  return problems.badRequest(c, result.error || "Invalid or expired reset token");
3738
3749
  }