title: how to create a login form using sinatra
body: <p>I have been looking for info on how to create a simple login form using Sinatra. I have checked the Sinatra documents and I have seen that Rack might need to be implemented which is fine. The code in the document I am talking about is this: </p>
  
  <pre><code>require 'sinatra'
  use Rack::Auth::Basic, "Restricted Area" do |username, password|
      username == 'admin' and password == 'admin'
  end
  
  get '/' do
     "You're welcome"
  end
  </code></pre>
  
  <p>when that is implemented it ask for a username and password to get into the routed page
  what I'm trying to do is on the index page there is a form with the normal username and password and submit button once an admin or valid user logs in they get on to the next page which is the app. The form I am using is made using Slim and would be the first page of the app: </p>
  
  <pre><code>  form#logger action="/login" method="post" name="logger" 
      tr
        p.logLabel Username
        input type="text" 
      tr
        p.logLabel Password
        input type="password" 
      tr
        input name="login" type="submit" value="Submit"  
  </code></pre>
  
  <p>Any help is appreciated.</p>