diff --git a/app.js b/app.js
index 59d591c..b10a819 100644
--- a/app.js
+++ b/app.js
@@ -18,6 +18,7 @@ app.use(session({ secret: buf.toString('hex'), resave: false, saveUninitialized:
 if (process.env.NODE_ENV != "development") {
     const passport   = require('./models/passport')(db);
     app.use(passport.initialize());
+    app.use(passport.session());
     app.get('/auth/github',
         passport.authenticate('github'));
 
@@ -26,8 +27,18 @@ if (process.env.NODE_ENV != "development") {
         function(req, res) {
             res.redirect('/admin');
         });
+    
+    app.get('/logout',
+        function (req, res) {
+            req.logout()
+            res.redirect('/admin')
+        })
 }
 
+app.use(function (req, res, next) {
+    res.locals.user = req.user
+    next();
+})
 app.use(flash());
 app.engine('.hbs', exphbs({defaultLayout: 'default', extname: '.hbs'}));
 app.set('views', path.join(__dirname, 'views'));
diff --git a/models/passport.js b/models/passport.js
index 18371fe..b8e441f 100644
--- a/models/passport.js
+++ b/models/passport.js
@@ -1,5 +1,6 @@
 var passport = require('passport');
 const config = require('config');
+const db = require('./db')
 
 function initPassport(db) {
 
@@ -13,11 +14,12 @@ function initPassport(db) {
     },
         function(accessToken, refreshToken, profile, cb) {
             if (admins.indexOf(profile.username) > -1) {
-                User.findOrCreate({ githubId: profile.id }, function (err, user) {
-                    return done(err, user);
-                });
+                db.User.findOrCreate({ where: { githubId: profile.id } })
+                    .then(user => {
+                        return cb(null, user[0]);
+                    })
             } else {
-                return done(null, null);      
+                return cb(null, null);      
             }
         }
     ));
@@ -27,7 +29,7 @@ function initPassport(db) {
     }
 
     function deserialize(id, done) {
-        db.User.findById(id).then(user => {
+        db.User.findOne({ where: { id: id } }).then(user => {
             if (user) {
                 return done(null, { id: user.id });
             } else {
diff --git a/package-lock.json b/package-lock.json
index 01e481e..edebcb1 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
 {
-  "name": "rsvp-endpoint",
-  "version": "1.0.0",
+  "name": "restful-wedding",
+  "version": "1.0.2",
   "lockfileVersion": 1,
   "requires": true,
   "dependencies": {
@@ -1798,9 +1798,9 @@
       }
     },
     "psl": {
-      "version": "1.1.31",
-      "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz",
-      "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw=="
+      "version": "1.1.32",
+      "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.32.tgz",
+      "integrity": "sha512-MHACAkHpihU/REGGPLj4sEfc/XKW2bheigvHO1dUqjaKigMp1C8+WLQYRGgeKFMsw5PMfegZcaN8IDXK/cD0+g=="
     },
     "pump": {
       "version": "3.0.0",
diff --git a/routes/admin.js b/routes/admin.js
index dc00845..1f2b00a 100644
--- a/routes/admin.js
+++ b/routes/admin.js
@@ -6,10 +6,12 @@ const async = require('async');
 const Op = require('sequelize').Op;
 
 router.use(function (req, res, next) {
-    if (req.app.get('env') == 'developmeny') {
+    if (req.app.get('env') == 'development') {
         return next();
+    } else if (req.isAuthenticated()) {
+        return next()
     } else {
-        return passport.authenticate('github');
+        return res.status(401).render('error', { message: 'Unauthorized' });
     }
 })
 
@@ -97,7 +99,6 @@ router.post('/guests', function (req, res) {
                 });
             });
         }).catch(error => {
-            console.log(error.message);
             res.locals.userMessage = error.message;
             return guestView(req, res);
         });
diff --git a/views/layouts/default.hbs b/views/layouts/default.hbs
index ade44fc..98c8bfc 100644
--- a/views/layouts/default.hbs
+++ b/views/layouts/default.hbs
@@ -49,13 +49,20 @@
       </button>
       <div class="collapse navbar-collapse" id="navbarNavAltMarkup">
         <div class="navbar-nav">
+        {{#if user}}
           <a class="nav-item nav-link" href="{{path}}/admin/">Summary</a>
           <a class="nav-item nav-link" href="{{path}}/admin/guests">Guests</a>
           <a class="nav-item nav-link" href="{{path}}/admin/households">Households</a>
           <a class="nav-item nav-link" href="{{path}}/admin/mealoptions">Meal Options</a>
           <a class="nav-item nav-link" href="{{path}}/admin/message">Message</a>
+        {{/if}}
         </div>
       </div>
+      {{#if user}}
+      <span><a href="/logout"><button type="submit" class="btn btn-outline-danger navbar-btn login-btn">Log Out</button></a></span>
+      {{else}}
+      <span><a href="/auth/github"><button type="submit" class="btn btn-outline-success navbar-btn login-btn">Log In</button></a></span>
+      {{/if}}
     </nav>
 
     <div class="container">
