From 7b0058e7a5e0594b4e83acfacf21d9d6a4e1c649 Mon Sep 17 00:00:00 2001 From: philc Date: Tue, 24 Dec 2024 12:19:41 +0100 Subject: [PATCH] check if search exist and is correct in recovery key --- apxtri/models/Pagans.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/apxtri/models/Pagans.js b/apxtri/models/Pagans.js index 32d8ead..35a7962 100644 --- a/apxtri/models/Pagans.js +++ b/apxtri/models/Pagans.js @@ -58,12 +58,28 @@ Pagans.keyrecovery = (emailalias, tribe, search, lg) => { search, lg ); + if (!search || search.length<3) { + console.log( + currentmod, + "issue with search : emailalias, tribe, search, lg:", + emailalias, + tribe, + search, + lg + ); + return { + status: 406, + ref: "Pagans", + msg: "nosearchstring", + data: {emailalias,tribe,search,lg}, + }; + } if (!["email", "alias"].includes(emailalias)) { return { status: 406, ref: "Pagans", msg: "emailaliasnotemailoralias", - data: {}, + data: {emailalias,tribe,search,lg}, }; } let emaillist = [];