Sha256: 2ca004e9a5f6e9584f020452a7241db294523a2fc49141b733c30811207dc3a0

Contents?: true

Size: 337 Bytes

Versions: 10

Compression:

Stored size: 337 Bytes

Contents

class Sessions::SudosController < ApplicationController
  def create
    session = Current.session

    if session.<%= singular_table_name %>.authenticate(params[:password])
      session.update! sudo_at: Time.current
    else
      render json: { error: "The password you entered is incorrect" }, status: :bad_request
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
authentication-zero-2.10.0 lib/generators/authentication/templates/controllers/api/sessions/sudos_controller.rb.tt
authentication-zero-2.9.3 lib/generators/authentication/templates/controllers/api/sessions/sudos_controller.rb.tt
authentication-zero-2.9.2 lib/generators/authentication/templates/controllers/api/sessions/sudos_controller.rb.tt
authentication-zero-2.9.1 lib/generators/authentication/templates/controllers/api/sessions/sudos_controller.rb.tt
authentication-zero-2.9.0 lib/generators/authentication/templates/controllers/api/sessions/sudos_controller.rb.tt
authentication-zero-2.8.4 lib/generators/authentication/templates/controllers/api/sessions/sudos_controller.rb.tt
authentication-zero-2.8.3 lib/generators/authentication/templates/controllers/api/sessions/sudos_controller.rb.tt
authentication-zero-2.8.2 lib/generators/authentication/templates/controllers/api/sessions/sudos_controller.rb.tt
authentication-zero-2.8.1 lib/generators/authentication/templates/controllers/api/sessions/sudos_controller.rb.tt
authentication-zero-2.8.0 lib/generators/authentication/templates/controllers/api/sessions/sudos_controller.rb.tt