@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.cjs +13 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4109,7 +4109,7 @@ var resetPasswordRoute = (0, import_zod_openapi8.createRoute)({
|
|
|
4109
4109
|
});
|
|
4110
4110
|
var resetPasswordHandler = async (c) => {
|
|
4111
4111
|
const { token, password, turnstileToken } = c.req.valid("json");
|
|
4112
|
-
const database = c
|
|
4112
|
+
const { db: database, schema } = getAuthContext(c);
|
|
4113
4113
|
const env = c.env;
|
|
4114
4114
|
const turnstileValid = await verifyTurnstileToken(
|
|
4115
4115
|
turnstileToken,
|
|
@@ -4124,7 +4124,18 @@ var resetPasswordHandler = async (c) => {
|
|
|
4124
4124
|
if (!passwordValidation.valid) {
|
|
4125
4125
|
return problems.badRequest(c, passwordValidation.error || "Invalid password");
|
|
4126
4126
|
}
|
|
4127
|
-
const result = await resetPassword(
|
|
4127
|
+
const result = await resetPassword(
|
|
4128
|
+
database,
|
|
4129
|
+
{
|
|
4130
|
+
users: schema.users,
|
|
4131
|
+
passwordResetTokens: schema.passwordResetTokens,
|
|
4132
|
+
sessions: schema.sessions
|
|
4133
|
+
},
|
|
4134
|
+
token,
|
|
4135
|
+
password,
|
|
4136
|
+
env.PASSWORD_PEPPER_V1,
|
|
4137
|
+
"v1"
|
|
4138
|
+
);
|
|
4128
4139
|
if (!result.success) {
|
|
4129
4140
|
return problems.badRequest(c, result.error || "Invalid or expired reset token");
|
|
4130
4141
|
}
|