mehedi
mehedi4mo ago

how can I call these actions inside crypto verifySecret function?

"use node";

import { action } from "./_generated/server";
import { v } from "convex/values";
import hasher from "wordpress-hash-node";

export const hashPassword = action({
args: { password: v.string() },
handler: async (ctx, args) => {
const hash = hasher.HashPassword(args.password);
return hash;
},
});

export const checkPassword = action({
args: { password: v.string(), hash: v.string() },
handler: async (ctx, args) => {
const checked = hasher.CheckPassword(args.password, args.hash);
return checked;
},
});
"use node";

import { action } from "./_generated/server";
import { v } from "convex/values";
import hasher from "wordpress-hash-node";

export const hashPassword = action({
args: { password: v.string() },
handler: async (ctx, args) => {
const hash = hasher.HashPassword(args.password);
return hash;
},
});

export const checkPassword = action({
args: { password: v.string(), hash: v.string() },
handler: async (ctx, args) => {
const checked = hasher.CheckPassword(args.password, args.hash);
return checked;
},
});
1 Reply
erquhart
erquhart4mo ago
Don't make them separate actions, just run your hasher methods inline wherever you're doing the secret verification.

Did you find this page helpful?