mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-24 05:46:39 +00:00
reset password flow
This commit is contained in:
@@ -10,6 +10,7 @@ import { hash } from "@node-rs/argon2";
|
||||
import { response } from "@server/utils";
|
||||
import stoi from "@server/utils/stoi";
|
||||
import logger from "@server/logger";
|
||||
import { hashPassword } from "@server/auth/password";
|
||||
|
||||
const setResourceAuthMethodsParamsSchema = z.object({
|
||||
resourceId: z.string().transform(Number).pipe(z.number().int().positive()),
|
||||
@@ -61,12 +62,7 @@ export async function setResourcePincode(
|
||||
.where(eq(resourcePincode.resourceId, resourceId));
|
||||
|
||||
if (pincode) {
|
||||
const pincodeHash = await hash(pincode, {
|
||||
memoryCost: 19456,
|
||||
timeCost: 2,
|
||||
outputLen: 32,
|
||||
parallelism: 1,
|
||||
});
|
||||
const pincodeHash = await hashPassword(pincode);
|
||||
|
||||
await trx
|
||||
.insert(resourcePincode)
|
||||
|
||||
Reference in New Issue
Block a user