# Gatleon Rails add authentication to your website - in 1 minute or less. ## Installation Add this line to your application's Gemfile: ```ruby gem "gatleon-rails" ``` And then execute: ``` $ bundle install ``` Add a profile controller ```ruby class ProfileController < ActionController::Base AUTHFORM_FORM_SECRET_KEY = "" # Available at https://authform.gatleon.com. coming soon! AUTHFORM_FORM_PUBLIC_KEY = "" # Available at https://authform.gatleon.com. coming soon! include Gatleon::Rails::Authform::Concern.new(public_key: AUTHFORM_FORM_PUBLIC_KEY, secret_key: AUTHFORM_FORM_SECRET_KEY) before_action :require_login, only: [:index] def index erb = <<~ERB

Profile

You are signed in.

<%= current_user %>

ERB render inline: erb end def signin erb = <<~ERB

<%= flash[:error] %>

Sign In

ERB render inline: erb end private def require_login unless current_user flash[:error] = "Sign in, please." redirect_to(profile_signin_path) and return end end end ``` Add profile routes to routes.rb ```ruby Rails.application.routes.draw do get '/profile', to: 'profile#index', as: 'profile' get '/profile/signin', to: 'profile#signin', as: 'profile_signin' end ``` That's it! ## License The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).