Changeset View
Changeset View
Standalone View
Standalone View
lib/http/routes/finalize-password-reset.js
Show All 12 Lines | async (app, context, params) => { | ||||
"show", | "show", | ||||
{ filter: { token: params.token } } | { filter: { token: params.token } } | ||||
); | ); | ||||
if (matches.length === 0) { | if (matches.length === 0) { | ||||
throw new Error("Incorrect token"); | throw new Error("Incorrect token"); | ||||
} else if (matches.length > 1) { | } else if (matches.length > 1) { | ||||
throw new Error("Something went wrong."); | throw new Error("Something went wrong."); | ||||
} | } | ||||
const user_email = matches[0].body.email; | const user_email = matches[0].email; | ||||
const { | const { | ||||
items: [user], | items: [user], | ||||
} = await app.run_action( | } = await app.run_action( | ||||
new app.Sealious.SuperContext(), | new app.Sealious.SuperContext(), | ||||
["collections", "users"], | ["collections", "users"], | ||||
"show", | "show", | ||||
{ filter: { email: user_email } } | { filter: { email: user_email } } | ||||
); | ); | ||||
Show All 18 Lines |