mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
oauth: github: handle private email
This commit is contained in:
1 parent
f186278a5a
commit
5182031bca
5 files changed
+18
-5
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user