fix(passwordless): Reduce db calls, run in parallel
Adds validations, reduces the number of database calls, separates concers. reduces logic
This commit is contained in:
committed by
mrugesh mohapatra
parent
44c2eb65d5
commit
750c9f1eab
@ -16,3 +16,13 @@ export function wrapHandledError(err, {
|
||||
err[_handledError] = { type, message, redirectTo };
|
||||
return err;
|
||||
}
|
||||
|
||||
export const createValidatorErrorFormatter = (type, redirectTo) =>
|
||||
({ msg }) => wrapHandledError(
|
||||
new Error(msg),
|
||||
{
|
||||
type,
|
||||
message: msg,
|
||||
redirectTo
|
||||
}
|
||||
);
|
||||
|
Reference in New Issue
Block a user