Skip to main content

Logging In/Out Header Actions

When working locally, or in any environment where you use any of Devise's authentication methods besides devise_ceal_authenticatable, this gem provides a set of action buttons in the header to manage your session. If there is no current session, a Login button is shown. If there is a current session, a Logout button is shown.

These buttons only appear if the following conditions are met:

  • There is a user_signed_in? method available
    • This is provided by the devise(:database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable) declaration in models/user.rb
  • There is a destroy_user_session_path defined in the parent application's routes
  • There is a new_user_session_path defined in the parent application's routes
    • These are provided by the devise_for :users declaration in the routes.rb file

In addition, this gem provides a set of views to manage local users in the Devise database_authenticatable context, including self-registration, login, and password recovery. These views shadow over the generic Devise gem-provided views, and are designed to match the rest of the PMACS Frontend views.