File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -171,23 +171,17 @@ This requires you to implement several methods::
171171 */
172172 public function supports(Request $request)
173173 {
174- return true;
174+ return $request->headers->has('X-AUTH-TOKEN')
175175 }
176176
177177 /**
178178 * Called on every request. Return whatever credentials you want to
179- * be passed to getUser().
179+ * be passed to getUser() as $credentials .
180180 */
181181 public function getCredentials(Request $request)
182182 {
183- if (!$token = $request->headers->get('X-AUTH-TOKEN')) {
184- // No token?
185- $token = null;
186- }
187-
188- // What you return here will be passed to getUser() as $credentials
189183 return array(
190- 'token' => $token ,
184+ 'token' => $request->headers->get('X-AUTH-TOKEN') ,
191185 );
192186 }
193187
You can’t perform that action at this time.
0 commit comments