pull/26/head
Ondřej Hruška 6 years ago
parent fd296e2d8f
commit 1ab7b7a3c4
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 6
      routes/web.php
  2. 3
      sideload/socialnorm/socialnorm/src/SocialNorm.php

@ -35,11 +35,9 @@ Route::get('/auth/github/callback', function() {
try { try {
SocialAuth::login('github'); SocialAuth::login('github');
} catch (ApplicationRejectedException $e) { } catch (ApplicationRejectedException $e) {
dd($e); abort(401, $e->getMessage());
abort(401);
} catch (InvalidAuthorizationCodeException $e) { } catch (InvalidAuthorizationCodeException $e) {
dd($e); abort(401, $e->getMessage());
abort(401);
} }
return Redirect::intended(); return Redirect::intended();
})->name('oauth-github-login'); })->name('oauth-github-login');

@ -31,7 +31,6 @@ class SocialNorm
{ {
$state = $this->stateGenerator->generate(); $state = $this->stateGenerator->generate();
// this is for some reason needed, plain put doesn't work across the redirect
\Session::put('oauth.state', $state); \Session::put('oauth.state', $state);
\Session::save(); \Session::save();
@ -52,7 +51,7 @@ class SocialNorm
protected function verifyState() protected function verifyState()
{ {
if (\Session::get('oauth.state') !== $this->request->state()) { if (\Session::get('oauth.state') !== $this->request->state()) {
throw new InvalidAuthorizationCodeException; throw new InvalidAuthorizationCodeException("State failed to verify");
} }
} }
} }

Loading…
Cancel
Save