From d3e4bb3ed2585859a3adeb7eeff35b7c75ebd840 Mon Sep 17 00:00:00 2001
From: Jules Laplace <julescarbon@gmail.com>
Date: Sun, 16 Sep 2018 22:40:05 +0200
Subject: auth gate on main app. pull in auth routes from bucky.

---
 app/client/index.jsx | 27 +++++++++++++++------------
 1 file changed, 15 insertions(+), 12 deletions(-)

(limited to 'app/client/index.jsx')

diff --git a/app/client/index.jsx b/app/client/index.jsx
index fd4679c..614bb35 100644
--- a/app/client/index.jsx
+++ b/app/client/index.jsx
@@ -7,8 +7,8 @@ import { store, history } from './store'
 import * as socket from './socket'
 import util from './util'
 
-import Header from './common/header.component'
-import AudioPlayer from './common/audioPlayer/audioPlayer.component'
+import Auth from './auth'
+import { Header, AudioPlayer } from './common'
 import System from './system/system.component'
 import Dashboard from './dashboard/dashboard.component'
 import modules from './modules'
@@ -22,16 +22,19 @@ const module_list = Object.keys(modules).map(name => {
 
 const app = (
   <Provider store={store}>
-    <BrowserRouter>
-      <div>
-        <Route exact path='/' component={Dashboard} />
-        <Route path='/system/' component={System} />
-        <Route path='/dashboard/' component={Dashboard} />
-        {module_list}
-        <Route path='/' component={Header} />
-        <AudioPlayer />
-      </div>
-    </BrowserRouter>
+    <Auth.Gate>
+      <BrowserRouter>
+        <div>
+          <Route exact path='/' component={Dashboard} />
+          <Route path='/system/' component={System} />
+          <Route path='/dashboard/' component={Dashboard} />
+          <Route path='/logout/' component={Auth.Logout} />
+          {module_list}
+          <Route path='/' component={Header} />
+          <AudioPlayer />
+        </div>
+      </BrowserRouter>
+    </Auth.Gate>
   </Provider>
 )
 
-- 
cgit v1.2.3-70-g09d2

