mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
update model.user.create() api
This commit is contained in:
1 parent
162d93e5db
commit
37756c3724
14 files changed
+31
-57
No files matched your search
@@ -102,9 +102,7 @@ class UserRegisterWithCodeHandler extends Handler {
|
||||
if (!mail) throw new InvalidTokenError(token.TYPE_REGISTRATION, code);
|
||||
if (password !== verifyPassword) throw new VerifyPasswordError();
|
||||
const uid = await system.inc('user');
|
||||
await user.create({
|
||||
uid, uname, password, mail, regip: this.request.ip,
|
||||
});
|
||||
await user.create(mail, uname, password, uid, this.request.ip);
|
||||
await token.del(code, token.TYPE_REGISTRATION);
|
||||
this.session.uid = uid;
|
||||
this.response.redirect = this.url('homepage');
|
||||
@@ -331,9 +329,10 @@ class OauthCallbackHandler extends Handler {
|
||||
break;
|
||||
}
|
||||
}
|
||||
const uid = await user.create({
|
||||
mail: r.email, uname: username, password: String.random(32), regip: this.request.ip,
|
||||
});
|
||||
const uid = await user.create(
|
||||
r.email, username, String.random(32),
|
||||
undefined, this.request.ip,
|
||||
);
|
||||
const $set: any = {
|
||||
oauth: args.type,
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user