exports = module.exports = function(parse, csrfProtection, loadState, authenticate, proceed) {
  
  // TODO: Move this file to "password/handlers/authenticate"
  
  return [
    parse('application/x-www-form-urlencoded'),
    csrfProtection(),
    loadState('login'),
    authenticate('local'),
    proceed
  ];
};

exports['@require'] = [
  'http://i.bixbyjs.org/http/middleware/parse',
  'http://i.bixbyjs.org/http/middleware/csrfProtection',
  'http://i.bixbyjs.org/http/middleware/loadState',
  'http://i.bixbyjs.org/http/middleware/authenticate',
  '../../workflow/login/resume'
];

@@ -35,16 +35,22 @@
 n(parse,
+ flow,
  csrfPro
@@ -61,19 +61,8 @@
 ion,
- loadState,
  aut
@@ -74,85 +74,11 @@
 cate
-, proceed) %7B%0A  %0A  // TODO: Move this file to %22password/handlers/authenticate%22
+) %7B
 %0A  %0A
@@ -144,50 +144,64 @@
     
-csrfProtection(),%0A    loadState('login'
+flow('authenticate-password',%0A      csrfProtection(
 ),%0A
+  
     
@@ -217,29 +217,47 @@
 ate(
+%5B 
 'local'
+ %5D
 ),%0A    
-proceed
+%7B through: 'login' %7D)
 %0A  %5D
@@ -330,24 +330,77 @@
 are/parse',%0A
+  'http://i.bixbyjs.org/http/middleware/state/flow',%0A
   'http://i.
@@ -488,104 +488,19 @@
 are/
-loadState',%0A  'http://i.bixbyjs.org/http/middleware/authenticate',%0A  '../../workflow/login/resum
+authenticat
 e'%0A%5D

Switch to DSL for password authentication.