Skip to content

Commit

Permalink
Doctrine cannot handle bare random non-utf8 strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Terje Bråten committed Mar 31, 2013
1 parent 92501eb commit 751abe1
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -99,7 +99,7 @@ protected function processAutoLoginCookie(array $cookieParts, Request $request)
}

$series = $persistentToken->getSeries();
$tokenValue = $this->secureRandom->nextBytes(64);
$tokenValue = base64_encode($this->secureRandom->nextBytes(64));
$this->tokenProvider->updateToken($series, $tokenValue, new \DateTime());
$request->attributes->set(self::COOKIE_ATTR_NAME,
new Cookie(
Expand All @@ -121,8 +121,8 @@ protected function processAutoLoginCookie(array $cookieParts, Request $request)
*/
protected function onLoginSuccess(Request $request, Response $response, TokenInterface $token)
{
$series = $this->secureRandom->nextBytes(64);
$tokenValue = $this->secureRandom->nextBytes(64);
$series = base64_encode($this->secureRandom->nextBytes(64));
$tokenValue = base64_encode($this->secureRandom->nextBytes(64));

$this->tokenProvider->createNewToken(
new PersistentToken(
Expand Down

0 comments on commit 751abe1

Please sign in to comment.