oauth: github: handle private email

This commit is contained in:
undefined committed 2022-02-09 20:32:46 +08:00
1 parent f186278a5a
commit 5182031bca
5 files changed
+18 -5

No files matched your search

+2
View File
@@ -381,6 +381,8 @@ class OauthCallbackHandler extends Handler {
let username = '';
r.uname = r.uname || [];
r.uname.push(String.random(16));
const mailDomain = r.email.split('@')[1];
if (await BlackListModel.get(`mail::${mailDomain}`)) throw new BlacklistedError(mailDomain);
for (const uname of r.uname) {
// eslint-disable-next-line no-await-in-loop
const nudoc = await user.getByUname('system', uname);