From 15f73567b6b423d62d970573372c079592cfcc02 Mon Sep 17 00:00:00 2001 From: Marco Date: Sun, 30 Jul 2017 19:59:09 +0200 Subject: [PATCH] Update accounts by ID instead of email after confirming email address --- src/Auth.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Auth.php b/src/Auth.php index 80eeb72..1db0ff1 100644 --- a/src/Auth.php +++ b/src/Auth.php @@ -482,7 +482,7 @@ final class Auth extends UserManager { try { $confirmationData = $this->db->selectRow( - 'SELECT id, email, token, expires FROM ' . $this->dbTablePrefix . 'users_confirmations WHERE selector = ?', + 'SELECT id, user_id, email, token, expires FROM ' . $this->dbTablePrefix . 'users_confirmations WHERE selector = ?', [ $selector ] ); } @@ -497,7 +497,7 @@ final class Auth extends UserManager { $this->db->update( $this->dbTablePrefix . 'users', [ 'verified' => 1 ], - [ 'email' => $confirmationData['email'] ] + [ 'id' => $confirmationData['user_id'] ] ); } catch (Error $e) {