fixed the problem with SocialNorm, turned out to be due to bad config of session

pull/26/head
Ondřej Hruška 7 years ago
parent 21bebc1ebf
commit 598f2f8024
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 2
      config/session.php
  2. 9
      sideload/socialnorm/socialnorm/src/SocialNorm.php

@ -192,6 +192,6 @@ return [
|
*/
'same_site' => null,
'same_site' => 'lax', // this was changed, leaving it as 'null' caused session to be reset during oAuth2 login
];

@ -31,8 +31,7 @@ class SocialNorm
{
$state = $this->stateGenerator->generate();
\Session::put('oauth.state', $state);
\Session::save();
$this->session->put('oauth.state', $state);
return $this->getProvider($providerAlias)->authorizeUrl($state);
}
@ -50,8 +49,8 @@ class SocialNorm
protected function verifyState()
{
// if (\Session::get('oauth.state') !== $this->request->state()) {
// throw new InvalidAuthorizationCodeException("State failed to verify");
// }
if ($this->session->get('oauth.state') !== $this->request->state()) {
throw new InvalidAuthorizationCodeException("State failed to verify");
}
}
}

Loading…
Cancel
Save