Fix registration password proof set too early

This commit is contained in:
Alice Gaudon 2020-11-04 12:05:23 +01:00
parent aebc03d5e9
commit 43848e93a3
1 changed files with 3 additions and 2 deletions

View File

@ -88,8 +88,6 @@ export default class AuthController extends _AuthController {
try {
await this.getApp().as(AuthComponent).getAuthGuard().authenticateOrRegister(req.session, passwordAuthProof,
undefined, async (connection, user) => {
passwordAuthProof.setResource(user);
const callbacks: RegisterCallback[] = [];
// Password
@ -99,6 +97,9 @@ export default class AuthController extends _AuthController {
user.as(UserNameComponent).name = req.body.username;
return callbacks;
}, async (connection, user) => {
passwordAuthProof.setResource(user);
return [];
});
} catch (e) {
if (e instanceof PendingApprovalAuthError) {