Advertisement
Guest User

Untitled

a guest
Feb 20th, 2014
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (def users {"root@root.de" {:username "root"
  2.                     :password (creds/hash-bcrypt "zzzzzz")
  3.                     :roles #{::admin}}
  4.             "jane" {:username "jane"
  5.                     :password (creds/hash-bcrypt "zzzzzz")
  6.                     :roles #{::user}}})
  7.  
  8. (def friend-settings
  9.   {:credential-fn (partial creds/bcrypt-credential-fn users)
  10.    :workflows [(workflows/interactive-form)]
  11.    :login-uri "/login"
  12.    :unauthorized-redirect-uri "/login"
  13.    :default-landing-uri "/"})
  14.  
  15. (friend/authenticate user-routes friend-settings)
  16.  
  17.  
  18. <form class="form-horizontal" role="form" action="login" method="POST">
  19.               <div class="form-group">
  20.                 <label for="inputEmail3" class="col-sm-2 control-label">Email</label>
  21.                 <div class="col-sm-10">
  22.                   <input type="email" class="form-control" name="email" placeholder="Email">
  23.                 </div>
  24.               </div>
  25.               <div class="form-group">
  26.                 <label for="inputPassword3" class="col-sm-2 control-label">Password</label>
  27.                 <div class="col-sm-10">
  28.                   <input type="password" class="form-control" name="password" placeholder="Password">
  29.                 </div>
  30.               </div>
  31.               <div class="form-group">
  32.                 <div class="col-sm-offset-2 col-sm-10">
  33.                   <button type="submit" class="btn btn-default">Sign in</button>
  34.                 </div>
  35.               </div>
  36.             </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement