File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -297,7 +297,7 @@ public function getLoginName() {
297297 */
298298 public function login ($ uid , $ password ) {
299299 $ this ->session ->regenerateId ();
300- if ($ this ->validateToken ($ password )) {
300+ if ($ this ->validateToken ($ password, $ uid )) {
301301 $ user = $ this ->getUser ();
302302
303303 // When logging in with token, the password must be decrypted first before passing to login hook
@@ -532,13 +532,17 @@ private function getPassword($password) {
532532
533533 /**
534534 * @param string $token
535+ * @param string $uid
535536 * @return boolean
536537 */
537- private function validateToken ($ token ) {
538+ private function validateToken ($ token, $ uid = null ) {
538539 try {
539540 $ token = $ this ->tokenProvider ->validateToken ($ token );
541+ if (is_null ($ uid )) {
542+ $ uid = $ token ->getUID ();
543+ }
540544 if (!is_null ($ token )) {
541- $ result = $ this ->loginWithToken ($ token -> getUID () );
545+ $ result = $ this ->loginWithToken ($ uid );
542546 if ($ result ) {
543547 // Login success
544548 $ this ->updateToken ($ token );
You can’t perform that action at this time.
0 commit comments