File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -191,10 +191,10 @@ public function getToken($request = null)
191191 }
192192
193193 if (!empty ($ this ->_config ['parameter ' ])) {
194- $ token = $ request ->query ($ this ->_config ['parameter ' ]);
194+ $ this -> _token = $ request ->query ($ this ->_config ['parameter ' ]);
195195 }
196196
197- return $ this ->_token = $ token ;
197+ return $ this ->_token ;
198198 }
199199
200200 /**
Original file line number Diff line number Diff line change @@ -99,6 +99,24 @@ public function testAuthenticateTokenHeader()
9999 $ this ->assertFalse ($ result );
100100 }
101101
102+ /**
103+ * test authenticate no token present in header "parameter" option disabled.
104+ *
105+ * @return void
106+ */
107+ public function testAuthenticateNoHeaderWithParameterDisabled ()
108+ {
109+ $ request = new Request ('posts/index ' );
110+
111+ $ this ->auth = new JwtAuthenticate ($ this ->Registry , [
112+ 'userModel ' => 'Users ' ,
113+ 'parameter ' => false
114+ ]);
115+
116+ $ result = $ this ->auth ->getUser ($ request , $ this ->response );
117+ $ this ->assertFalse ($ result );
118+ }
119+
102120 /**
103121 * test returning payload without querying database.
104122 *
You can’t perform that action at this time.
0 commit comments