Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 1x 1x 146x 146x 146x 146x | import { hooks as authLocalHooks } from '@feathersjs/authentication-local'; import { Application, HookContext } from '@feathersjs/feathers'; export default async function hashPassword (app: Application, password: string, field: string): Promise<string> { Iif (!field) throw new Error('Field is missing'); const context = { type: 'before', data: { [field]: password }, params: { provider: null }, app }; const newContext = await authLocalHooks.hashPassword(field)(context as HookContext); return newContext.data[field]; } |