diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php
index 94407f7..58d9a86 100644
--- a/resources/views/auth/login.blade.php
+++ b/resources/views/auth/login.blade.php
@@ -65,10 +65,15 @@
diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php
index f6e81e3..daa9534 100644
--- a/resources/views/layouts/app.blade.php
+++ b/resources/views/layouts/app.blade.php
@@ -13,10 +13,6 @@
-
-
-
-
diff --git a/resources/views/welcome.blade.php b/resources/views/welcome.blade.php
index a246e10..a9ade54 100644
--- a/resources/views/welcome.blade.php
+++ b/resources/views/welcome.blade.php
@@ -1,95 +1,17 @@
-
-
-
-
-
-
-
- Laravel
-
-
-
-
-
-
-
-
-
- @if (Route::has('login'))
-
- @endif
-
-
-
-
-
+@extends('layouts.app')
+
+@section('content')
+
+
+
+
+
+
+
+
Welcome to the public landing page.
+
+
+
+
+
+@endsection
diff --git a/routes/web.php b/routes/web.php
index 754789c..1e2e2b7 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -17,6 +17,9 @@ Auth::routes();
Route::get('/', function () {
+ if (!Auth::guest()) {
+ return redirect('/home');
+ }
return view('welcome');
});
diff --git a/sideload/socialnorm/socialnorm/src/SocialNorm.php b/sideload/socialnorm/socialnorm/src/SocialNorm.php
index d7a8c82..1b4f9a4 100644
--- a/sideload/socialnorm/socialnorm/src/SocialNorm.php
+++ b/sideload/socialnorm/socialnorm/src/SocialNorm.php
@@ -1,56 +1,58 @@
providers = $providers;
- $this->session = $session;
- $this->request = $request;
- $this->stateGenerator = $stateGenerator;
- }
-
- public function registerProvider($alias, Provider $provider)
- {
- $this->providers->registerProvider($alias, $provider);
- }
-
- public function authorize($providerAlias)
- {
- $state = $this->stateGenerator->generate();
- $this->session->put('oauth.state', $state);
- return $this->getProvider($providerAlias)->authorizeUrl($state);
- }
-
- public function getUser($providerAlias)
- {
- $this->verifyState();
- return $this->getProvider($providerAlias)->getUser();
- }
-
- protected function getProvider($providerAlias)
- {
- return $this->providers->getProvider($providerAlias);
- }
-
- protected function verifyState()
- {
- // FIXME this is broken, can't find why
-// if ($this->session->get('oauth.state') !== $this->request->state()) {
-// throw new InvalidAuthorizationCodeException;
-// }
- }
+ protected $providers;
+ protected $session;
+ protected $request;
+ protected $stateGenerator;
+
+ public function __construct(
+ ProviderRegistry $providers,
+ Session $session,
+ Request $request,
+ StateGenerator $stateGenerator
+ )
+ {
+ $this->providers = $providers;
+ $this->session = $session;
+ $this->request = $request;
+ $this->stateGenerator = $stateGenerator;
+ }
+
+ public function registerProvider($alias, Provider $provider)
+ {
+ $this->providers->registerProvider($alias, $provider);
+ }
+
+ public function authorize($providerAlias)
+ {
+ $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();
+
+ return $this->getProvider($providerAlias)->authorizeUrl($state);
+ }
+
+ public function getUser($providerAlias)
+ {
+ $this->verifyState();
+ return $this->getProvider($providerAlias)->getUser();
+ }
+
+ protected function getProvider($providerAlias)
+ {
+ return $this->providers->getProvider($providerAlias);
+ }
+
+ protected function verifyState()
+ {
+ if (\Session::get('oauth.state') !== $this->request->state()) {
+ throw new InvalidAuthorizationCodeException;
+ }
+ }
}