class SessionsController

Public Instance Methods

create() click to toggle source
# File lib/generators/templates/controllers/sessions_controller.rb, line 9
def create
  <%= identity_model %> = <%= identity_model.classify %>.find_by(email: params[:session][:email])
  if <%= identity_model %> && <%= identity_model %>.authenticate(params[:session].delete(:password))
    session[:<%= "#{domain_model.underscore}_id" %>] = <%= identity_model %>.<%= "#{domain_model.underscore}_id" %>
    redirect_to(after_sign_in_path, notice: t(:'auto_auth.sessions.signed_in'))
  else
    flash.now[:alert] = t(:'auto_auth.sessions.bad_combination')
    render :new
  end
new() click to toggle source
# File lib/generators/templates/controllers/sessions_controller.rb, line 6
def new
end