           request: req
 
   login: (app) ->
-    
-    #
-    #     `Get admin page`
-    #    ----------------------------
-    #    
-    app.get "/admin", (req, res) ->
-      check = 0
-      categories = undefined
-      tags = undefined
-      entries = undefined
-      eventflow = new eventEmitter()
-      blog.getCategories (err, cat) ->
-        categories = cat
-        check++
-        eventflow.emit "render"  if check is 3
-        return
 
-      blog.getEntries 5, 0, (err, ent) ->
-        entries = ent
-        check++
-        eventflow.emit "render"  if check is 3
-        return
-
-      blog.getTags (err, tag) ->
-        tags = tag
-        check++
-        eventflow.emit "render"  if check is 3
-        return
-
-      eventflow.on "render", ->
-        res.render "admin",
-          entries: entries
-          categories: categories
-          tags: tags
-          config: config
-          request: req
-    
-    #
-    #     `Get login page`
-    #    ----------------------------
-    #    
-    app.get "/login", (req, res) ->
-      res.render "login",
-        title: "Fluid"
-        config: config
-        request: req
-
-    #
-    #     `Post login`
-    #    ----------------------------
-    #    
-    app.post "/login", (req, res, next) ->
-      _data = undefined
-      _data = null
-      user.checkPassword req.body.login, sha1(req.body.password), (err, data) ->
-        expirationTimestamp = undefined
-        return next(err)  if err
-        if data.check
-          req.session.logged_in = true
-          req.session.userId = data.userId
-          expirationTimestamp = (new Date()).getTime()
-          req.session.expirationDate = expirationTimestamp + 30 * 60 * 1000
-          req.session.login = req.body.email
-          res.redirect "/"
-        else
-          res.redirect "/login"
-
-    #
-    #     `Logout page`
-    #    ----------------------------
-    #    
-    app.get "/logout", checkAuth, (req, res) ->
-      delete req.session.logged_in
-
-      res.redirect "/login"
+  # app.get '/register', (req, res) ->
+  #   res.render 'register',
+  #     title: 'Disko'
+  #     {}
+  #
+  # app.post '/register', (req, res) ->
+  #   Account.register new Account(username: req.body.username), req.body.password, (err, account) ->
+  #     if err
+  #       res.render 'register',
+  #         info: "Sorry. That username already exists. Try again."
+  #
+  #     passport.authenticate 'local', (req, res) ->
+  #       res.redirect '/'
+  #
+  # app.get '/login', (req, res) ->
+  #   res.render 'login',
+  #     title: 'Disko'
+  #     user: req.user
+  #
+  # app.post '/login', passport.authenticate 'local', (req, res) ->
+  #   res.redirect '/'
+  #
+  # app.get '/logout', (req, res) ->
+  #   req.logout()
+  #   res.redirect '/'
 
   error: (app) ->
     

    #     `Update blog post`
    #    ----------------------------
    #    
    app.put "/blog/post/:id", checkAuth, (req, res) ->
      blog.editEntry req.params.id, req.body, (err, data) ->
        unless err
          res.json result: "OK"

    #     `Delete blog post`
    #    ----------------------------
    #    
    app.del "/blog/post/:id", (req, res) ->
      blog.removeEntry req.params.id, (err, data) ->
        if data > 0 and not err
          res.json result: "OK"
