pull/26/head
Ondřej Hruška 7 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 {
SocialAuth::login('github');
} catch (ApplicationRejectedException $e) {
dd($e);
abort(401);
abort(401, $e->getMessage());
} catch (InvalidAuthorizationCodeException $e) {
dd($e);
abort(401);
abort(401, $e->getMessage());
}
return Redirect::intended();
})->name('oauth-github-login');

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

Loading…
Cancel
Save