fix: [email_otp] Trim value for increased UX

pull/7092/head
Loïc Fortemps 2021-02-25 13:30:49 +01:00 committed by GitHub
parent e6c86072c4
commit 08f4211841
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1693,7 +1693,7 @@ class UsersController extends AppController
if ($this->request->is('post') && isset($this->request->data['User']['otp'])) {
$stored_otp = $redis->get('misp:otp:' . $user_id);
if (!empty($stored_otp) && $this->request->data['User']['otp'] == $stored_otp) {
if (!empty($stored_otp) && trim($this->request->data['User']['otp']) == $stored_otp) {
// we invalidate the previously generated OTP
$redis->del('misp:otp:' . $user_id);
// We login the user with CakePHP