diff --git a/config/session.php b/config/session.php index 736fb3c..3e142c9 100644 --- a/config/session.php +++ b/config/session.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 ]; diff --git a/sideload/socialnorm/socialnorm/src/SocialNorm.php b/sideload/socialnorm/socialnorm/src/SocialNorm.php index 753c45a..8607fd5 100644 --- a/sideload/socialnorm/socialnorm/src/SocialNorm.php +++ b/sideload/socialnorm/socialnorm/src/SocialNorm.php @@ -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"); + } } }