fix bug email recovery with alias
This commit is contained in:
		| @@ -49,7 +49,15 @@ Pagans.logout = (alias, tribe, xdays, xhash) => { | ||||
|  */ | ||||
|  | ||||
| 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)) { | ||||
|     return { | ||||
|       status: 406, | ||||
| @@ -71,14 +79,13 @@ Pagans.keyrecovery = (emailalias, tribe, search, lg) => { | ||||
|     } | ||||
|   } else { | ||||
|     const personpath = `../../${tribe}/objects/persons/itm/${search}.json`; | ||||
|  | ||||
|     if (fs.existsSync(personpath)) { | ||||
|       const person=fs.readFileSync(personpath) | ||||
|       if (person.recoveryauth) | ||||
|       emaillist.push({ alias: search, tribe, lg }); | ||||
|       const person = fs.readJSONSync(personpath); | ||||
|       if (person.recoveryauth) emaillist.push({ alias: search, tribe, lg }); | ||||
|     } | ||||
|   } | ||||
|   emaillist.forEach((e) => { | ||||
|     console.log(e); | ||||
|     const ret = Pagans.sendmailkey(e); | ||||
|   }); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user