user registration: fix late user save for when a user id is needed
This commit is contained in:
parent
4a13e8849d
commit
38a9c6ad15
@ -65,10 +65,10 @@ export default abstract class AuthGuard<P extends AuthProof<User>> {
|
||||
|
||||
await MysqlConnectionManager.wrapTransaction(async connection => {
|
||||
user = User.create({});
|
||||
await user.save(connection, c => callbacks.push(c));
|
||||
if (onRegister) {
|
||||
(await onRegister(connection, user)).forEach(c => callbacks.push(c));
|
||||
}
|
||||
await user.save(connection, c => callbacks.push(c));
|
||||
});
|
||||
|
||||
for (const callback of callbacks) {
|
||||
|
Loading…
Reference in New Issue
Block a user