From 309344d1c00c25821f662ad4eb42525ae9d7da71 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Sat, 9 May 2020 23:37:12 +0200 Subject: [PATCH] Fix missing fields when creating a new MagicLink --- package.json | 2 +- src/auth/magic_link/MagicLinkController.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 62ec5a7..1eb525c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wms-core", - "version": "0.4.28", + "version": "0.4.30", "description": "Node web framework", "repository": "git@gitlab.com:ArisuOngaku/wms-core.git", "author": "Alice Gaudon ", diff --git a/src/auth/magic_link/MagicLinkController.ts b/src/auth/magic_link/MagicLinkController.ts index 21e988a..42a2ab9 100644 --- a/src/auth/magic_link/MagicLinkController.ts +++ b/src/auth/magic_link/MagicLinkController.ts @@ -9,7 +9,7 @@ import MagicLink from "../models/MagicLink"; import config from "config"; 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 { + public static async sendMagicLink(sessionID: string, actionType: string, original_url: string, email: string, mailTemplate: MailTemplate, data: object, req: Request, res: Response): Promise { Throttler.throttle('magic_link', 2, MagicLink.validityPeriod(), sessionID, 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) { link = new MagicLink({ session_id: sessionID, + action_type: actionType, + original_url: original_url, }); }