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::
171
171
*/
172
172
public function supports(Request $request)
173
173
{
174
- return true;
174
+ return $request->headers->has('X-AUTH-TOKEN')
175
175
}
176
176
177
177
/**
178
178
* Called on every request. Return whatever credentials you want to
179
- * be passed to getUser().
179
+ * be passed to getUser() as $credentials .
180
180
*/
181
181
public function getCredentials(Request $request)
182
182
{
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
189
183
return array(
190
- 'token' => $token ,
184
+ 'token' => $request->headers->get('X-AUTH-TOKEN') ,
191
185
);
192
186
}
193
187
You can’t perform that action at this time.
0 commit comments