Skip to content

Improved code of custom authentication provider cookbook article #2614

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 10, 2013
Merged

Improved code of custom authentication provider cookbook article #2614

merged 3 commits into from
May 10, 2013

Conversation

FlyersWeb
Copy link

Improved source code of the article. Empty security Token and file_put_contents errors resolved.

@@ -233,6 +238,10 @@ the ``PasswordDigest`` header value matches with the user's password.
if (file_exists($this->cacheDir.'/'.$nonce) && file_get_contents($this->cacheDir.'/'.$nonce) + 300 > time()) {
throw new NonceExpiredException('Previously used nonce detected');
}
// If cache directory does not exist we create it
if ( !is_dir($this->cacheDir) ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you have to remove the spaces between ()

@@ -138,7 +138,7 @@ set an authenticated token in the security context if successful.
try {
$authToken = $this->authenticationManager->authenticate($token);

$this->securityContext->setToken($authToken);
return $this->securityContext->setToken($authToken);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setToken does not return anything so this is misleading. You should put a return; statement after it instead.

weaverryan added a commit that referenced this pull request May 10, 2013
…on_provider

Improved code of custom authentication provider cookbook article
@weaverryan weaverryan merged commit 9d84809 into symfony:2.1 May 10, 2013
@weaverryan
Copy link
Member

Merged, thanks for your updates!

@FlyersWeb FlyersWeb deleted the improving_custom_authentication_provider branch May 13, 2013 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants