Sha256: b53379c10e2c020df482372e8e8012777d37029169e3ba989a55caa283647b3b

Contents?: true

Size: 412 Bytes

Versions: 11

Compression:

Stored size: 412 Bytes

Contents

class SudosController < ApplicationController
  def new
  end

  def create
    session = Current.session

    if session.<%= singular_table_name %>.authenticate(params[:password])
      session.update!(sudo_at: Time.current); redirect_to(params[:proceed_to_url])
    else
      redirect_to new_sudo_path(proceed_to_url: params[:proceed_to_url]), alert: "The password you entered is incorrect"
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
authentication-zero-2.6.0 lib/generators/authentication/templates/controllers/html/sudos_controller.rb.tt
authentication-zero-2.5.1 lib/generators/authentication/templates/controllers/html/sudos_controller.rb.tt
authentication-zero-2.5.0 lib/generators/authentication/templates/controllers/html/sudos_controller.rb.tt
authentication-zero-2.4.0 lib/generators/authentication/templates/controllers/html/sudos_controller.rb.tt
authentication-zero-2.3.6 lib/generators/authentication/templates/controllers/html/sudos_controller.rb.tt
authentication-zero-2.3.5 lib/generators/authentication/templates/controllers/html/sudos_controller.rb.tt
authentication-zero-2.3.4 lib/generators/authentication/templates/controllers/html/sudos_controller.rb.tt
authentication-zero-2.3.3 lib/generators/authentication/templates/controllers/html/sudos_controller.rb.tt
authentication-zero-2.3.2 lib/generators/authentication/templates/controllers/html/sudos_controller.rb.tt
authentication-zero-2.3.1 lib/generators/authentication/templates/controllers/html/sudos_controller.rb.tt
authentication-zero-2.3.0 lib/generators/authentication/templates/controllers/html/sudos_controller.rb.tt