core: fix oauth user register & bind (#632) (#641)

pull/650/head
panda 1 year ago committed by GitHub
parent ced52792be
commit 301cd8e9d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -466,6 +466,7 @@ class OauthCallbackHandler extends Handler {
if (r.email) {
const udoc = await user.getByEmail('system', r.email);
if (udoc) {
await oauth.set(r._id, udoc._id);
await user.setById(udoc._id, { loginat: new Date(), loginip: this.request.ip });
this.session.uid = udoc._id;
this.session.scope = PERM.PERM_ALL.toString();
@ -498,7 +499,7 @@ class OauthCallbackHandler extends Handler {
username,
redirect: this.domain.registerRedirect,
set,
oauth: [args.type, r.email],
oauth: [args.type, r._id],
},
);
this.response.redirect = this.url('user_register_with_code', { code: t });

Loading…
Cancel
Save