forked from apxtri/apxtri
fix bug email recovery with alias
This commit is contained in:
parent
7b5df014be
commit
6d81688dde
@ -49,7 +49,15 @@ Pagans.logout = (alias, tribe, xdays, xhash) => {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
Pagans.keyrecovery = (emailalias, tribe, search, lg) => {
|
Pagans.keyrecovery = (emailalias, tribe, search, lg) => {
|
||||||
if (log) console.log(currentmod,":try to recover emailalias, tribe, search, lg:",emailalias,tribe,search,lg);
|
if (log)
|
||||||
|
console.log(
|
||||||
|
currentmod,
|
||||||
|
":try to recover emailalias, tribe, search, lg:",
|
||||||
|
emailalias,
|
||||||
|
tribe,
|
||||||
|
search,
|
||||||
|
lg
|
||||||
|
);
|
||||||
if (!["email", "alias"].includes(emailalias)) {
|
if (!["email", "alias"].includes(emailalias)) {
|
||||||
return {
|
return {
|
||||||
status: 406,
|
status: 406,
|
||||||
@ -71,14 +79,13 @@ Pagans.keyrecovery = (emailalias, tribe, search, lg) => {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const personpath = `../../${tribe}/objects/persons/itm/${search}.json`;
|
const personpath = `../../${tribe}/objects/persons/itm/${search}.json`;
|
||||||
|
|
||||||
if (fs.existsSync(personpath)) {
|
if (fs.existsSync(personpath)) {
|
||||||
const person=fs.readFileSync(personpath)
|
const person = fs.readJSONSync(personpath);
|
||||||
if (person.recoveryauth)
|
if (person.recoveryauth) emaillist.push({ alias: search, tribe, lg });
|
||||||
emaillist.push({ alias: search, tribe, lg });
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
emaillist.forEach((e) => {
|
emaillist.forEach((e) => {
|
||||||
console.log(e);
|
|
||||||
const ret = Pagans.sendmailkey(e);
|
const ret = Pagans.sendmailkey(e);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user