<% if rodauth.logged_in? %>
  <h1>You are logged in as <%= DB[:accounts].where(:id=>rodauth.session_value).get(:email) %></h1>
  <% if rodauth.two_factor_authenticated? %>
    <p>You have authenticated using multifactor authentication (<%= rodauth.authenticated_by.join(' and ') %>).</p>
  <% elsif rodauth.uses_two_factor_authentication? %>
    <p>You have logged in via single factor authentication (<%= rodauth.authenticated_by.first %>), but have not authenticated using multifactor authentication.</p>
  <% else %>
    <p>You have authenticated via <%= rodauth.authenticated_by.first %></p>
  <% end %>

  <ul>
    <li><a href="/change-login">Change Login</a></li>
    <li><a href="/change-password">Change Password</a></li>
    <li><a href="/close-account">Close Account</a></li>
    <li><a href="/remember">Change Remember Settings</a></li>
    <% if rodauth.logged_in_via_remember_key? %>
      <li><a href="/confirm-password">Confirm Password</a></li>
    <% end %>
    <% if rodauth.two_factor_partially_authenticated? %>
      <li><a href="/multifactor-auth">Authenticate Using Additional Factor</a></li>
    <% else %>
      <li><a href="/multifactor-manage">Manage Multifactor Authentication</a></li>
    <% end %>
  </ul>
<% else %>
  <h1>Overview</h1>

  <p>This is the demo site for <a href="https://github.com/jeremyevans/rodauth">Rodauth</a>.  Rodauth is an authentication and account management framework for rack applications, with the following design goals:</p>

  <ol>
    <li>Security: Ship in a maximum security by default configuration</li>
    <li>Simplicity: Allow for easy configuration via a DSL</li>
    <li>Flexibility: Allow for easy overriding of any part of the framework</li>
  </ol>

  <p>It's easiest to get started by going to the <a href="/login">login page</a>.</p>

  <p>This demo site is part of the Rodauth repository, so if you want to know how it works, you can <a href="https://github.com/jeremyevans/rodauth/tree/master/demo-site">review the source</a>.</p>
<% end %>
