<h1 class="byline">Rodauth: Ruby's Most Advanced Authentication Framework</h1>
<div class="row">
<div class="col-md-6">
<pre><code class="ruby"># cat config.ru
require "roda"

class RodauthApp &lt; Roda
  secret = ENV['SESSION_SECRET']
  plugin :sessions, secret: secret

  # If using Rodauth in a non-Roda application
  # plugin :middleware

  # JSON API
  #plugin :json
  #plugin :json_parser

  plugin :rodauth do
    enable :login, :logout, :verify_account
    enable :webauthn, :otp, :recovery_codes
    hmac_secret secret

    # JSON API
    #enable :jwt
    #jwt_secret secret
    #only_json? false
  end

  route do |r|
    r.rodauth

    rodauth.require_authentication

    # If using Rodauth in a Roda application
    # Your app code here
  end
end

# If using Rodauth in a non-Roda application
# use RodauthApp

# If using Rodauth in a Roda application
run RodauthApp
</code></pre>
</div>

<div class="col-md-6">
  <img src="images/rodauth.svg" width="600px" />
</div>
</div>

<p style="clear: both; margin-top: 40px;">Rodauth is Ruby's most advanced authentication framework.  Find out <a href="why.html">why you should use it</a>.</p>
