mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
1 parent
ced52792be
commit
301cd8e9d2
1 file changed
+2
-1
@@ -466,6 +466,7 @@ class OauthCallbackHandler extends Handler {
|
|||||||
if (r.email) {
|
if (r.email) {
|
||||||
const udoc = await user.getByEmail('system', r.email);
|
const udoc = await user.getByEmail('system', r.email);
|
||||||
if (udoc) {
|
if (udoc) {
|
||||||
|
await oauth.set(r._id, udoc._id);
|
||||||
await user.setById(udoc._id, { loginat: new Date(), loginip: this.request.ip });
|
await user.setById(udoc._id, { loginat: new Date(), loginip: this.request.ip });
|
||||||
this.session.uid = udoc._id;
|
this.session.uid = udoc._id;
|
||||||
this.session.scope = PERM.PERM_ALL.toString();
|
this.session.scope = PERM.PERM_ALL.toString();
|
||||||
@@ -498,7 +499,7 @@ class OauthCallbackHandler extends Handler {
|
|||||||
username,
|
username,
|
||||||
redirect: this.domain.registerRedirect,
|
redirect: this.domain.registerRedirect,
|
||||||
set,
|
set,
|
||||||
oauth: [args.type, r.email],
|
oauth: [args.type, r._id],
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
this.response.redirect = this.url('user_register_with_code', { code: t });
|
this.response.redirect = this.url('user_register_with_code', { code: t });
|
||||||
|
|||||||
Reference in new issue
Block a user