(authData, _, req)
| 183 | return saveResponse; |
| 184 | } |
| 185 | async validateUpdate(authData, _, req) { |
| 186 | if (req.master) { |
| 187 | return; |
| 188 | } |
| 189 | if (authData.mobile && this.sms) { |
| 190 | if (!authData.token) { |
| 191 | throw 'MFA is already set up on this account'; |
| 192 | } |
| 193 | return this.confirmSMSOTP(authData, req.original.get('authData')?.mfa || {}); |
| 194 | } |
| 195 | if (this.totp) { |
| 196 | await this.validateLogin({ token: authData.old }, null, req); |
| 197 | return this.validateSetUp(authData); |
| 198 | } |
| 199 | throw 'Invalid MFA data'; |
| 200 | } |
| 201 | afterFind(authData, options, req) { |
| 202 | if (req.master) { |
| 203 | return; |
no test coverage detected