File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -164,16 +164,15 @@ This requires you to implement six methods::
164
164
class TokenAuthenticator extends AbstractGuardAuthenticator
165
165
{
166
166
/**
167
- * Called on every request. Return whatever credentials you want, which
168
- * will be passed to getUser(). Returning null skips all other authentication
169
- * steps. Throwing an AuthenticationException will cause authentication to fail,
170
- * calling onAuthenticationFailure().
167
+ * Called on every request. Return whatever credentials you want to
168
+ * be passed to getUser(). Returning null will cause authentication
169
+ * to be successful, skipping the rest of the authentication process.
171
170
*/
172
171
public function getCredentials(Request $request)
173
172
{
174
173
if (!$token = $request->headers->get('X-AUTH-TOKEN')) {
175
- // No token? Cause authentication to fail.
176
- throw new AuthenticationException() ;
174
+ // No token?
175
+ $token = null ;
177
176
}
178
177
179
178
// What you return here will be passed to getUser() as $credentials
You can’t perform that action at this time.
0 commit comments