| @@ 189-191 (lines=3) @@ | ||
| 186 | return new ApiErrorResponse('verify_otp', 'invalid OTP key'); |
|
| 187 | } |
|
| 188 | ||
| 189 | if (false === $this->storage->recordTotpKey($userId, $totpKey, time())) { |
|
| 190 | return new ApiErrorResponse('verify_otp', 'OTP key replay'); |
|
| 191 | } |
|
| 192 | ||
| 193 | return new ApiResponse('verify_otp'); |
|
| 194 | } |
|
| @@ 76-78 (lines=3) @@ | ||
| 73 | ||
| 74 | // XXX check if all these things worked! |
|
| 75 | ||
| 76 | if (false === $this->storage->recordTotpKey($userId, $totpKey, time())) { |
|
| 77 | return new ApiErrorResponse('set_totp_secret', 'OTP key replay'); |
|
| 78 | } |
|
| 79 | $this->storage->setTotpSecret($userId, $totpSecret); |
|
| 80 | ||
| 81 | return new ApiResponse('set_totp_secret'); |
|
| @@ 103-105 (lines=3) @@ | ||
| 100 | return new ApiErrorResponse('verify_totp_key', 'invalid OTP key'); |
|
| 101 | } |
|
| 102 | ||
| 103 | if (false === $this->storage->recordTotpKey($userId, $totpKey, time())) { |
|
| 104 | return new ApiErrorResponse('verify_totp_key', 'OTP key replay'); |
|
| 105 | } |
|
| 106 | ||
| 107 | return new ApiResponse('verify_totp_key'); |
|
| 108 | } |
|