Fix missing fields when creating a new MagicLink
This commit is contained in:
parent
e574b6e778
commit
309344d1c0
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "wms-core",
|
"name": "wms-core",
|
||||||
"version": "0.4.28",
|
"version": "0.4.30",
|
||||||
"description": "Node web framework",
|
"description": "Node web framework",
|
||||||
"repository": "git@gitlab.com:ArisuOngaku/wms-core.git",
|
"repository": "git@gitlab.com:ArisuOngaku/wms-core.git",
|
||||||
"author": "Alice Gaudon <alice@gaudon.pro>",
|
"author": "Alice Gaudon <alice@gaudon.pro>",
|
||||||
|
@ -9,7 +9,7 @@ import MagicLink from "../models/MagicLink";
|
|||||||
import config from "config";
|
import config from "config";
|
||||||
|
|
||||||
export default abstract class MagicLinkController extends Controller {
|
export default abstract class MagicLinkController extends Controller {
|
||||||
public static async sendMagicLink(sessionID: string, actionType: string, email: string, mailTemplate: MailTemplate, data: object, req: Request, res: Response): Promise<void> {
|
public static async sendMagicLink(sessionID: string, actionType: string, original_url: string, email: string, mailTemplate: MailTemplate, data: object, req: Request, res: Response): Promise<void> {
|
||||||
Throttler.throttle('magic_link', 2, MagicLink.validityPeriod(), sessionID, 0, 0);
|
Throttler.throttle('magic_link', 2, MagicLink.validityPeriod(), sessionID, 0, 0);
|
||||||
Throttler.throttle('magic_link', 1, MagicLink.validityPeriod(), email, 0, 0);
|
Throttler.throttle('magic_link', 1, MagicLink.validityPeriod(), email, 0, 0);
|
||||||
|
|
||||||
@ -17,6 +17,8 @@ export default abstract class MagicLinkController extends Controller {
|
|||||||
if (!link) {
|
if (!link) {
|
||||||
link = new MagicLink({
|
link = new MagicLink({
|
||||||
session_id: sessionID,
|
session_id: sessionID,
|
||||||
|
action_type: actionType,
|
||||||
|
original_url: original_url,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user