Sha256: 50a813823b4bb2cd5d890fcbdc8ef0ebb40806f8f55d89b358da6f644711847a

Contents?: true

Size: 576 Bytes

Versions: 17

Compression:

Stored size: 576 Bytes

Contents

module PgEngine
  class BasePublicController < ApplicationController
    before_action do
      Current.namespace = :public
    end

    # :nocov:
    def login_as
      # TODO!: make a POST route
      return head :bad_request unless dev_user_or_env?

      Current.namespace = nil

      usuario = User.find(params[:id])
      if usuario.confirmed_at.present?
        sign_in(:user, usuario)
        # redirect_to after_sign_in_path_for(usuario)
        redirect_to users_root_path
      else
        go_back('No está confirmado')
      end
    end
    # :nocov:
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
pg_rails-7.6.23 pg_engine/app/controllers/pg_engine/base_public_controller.rb
pg_rails-7.6.22 pg_engine/app/controllers/pg_engine/base_public_controller.rb
pg_rails-7.6.22.pre.3 pg_engine/app/controllers/pg_engine/base_public_controller.rb
pg_rails-7.6.22.pre.2 pg_engine/app/controllers/pg_engine/base_public_controller.rb
pg_rails-7.6.22.pre.1 pg_engine/app/controllers/pg_engine/base_public_controller.rb
pg_rails-7.6.21 pg_engine/app/controllers/pg_engine/base_public_controller.rb
pg_rails-7.6.21.pre.11 pg_engine/app/controllers/pg_engine/base_public_controller.rb
pg_rails-7.6.21.pre.10 pg_engine/app/controllers/pg_engine/base_public_controller.rb
pg_rails-7.6.21.pre.9 pg_engine/app/controllers/pg_engine/base_public_controller.rb
pg_rails-7.6.21.pre.8 pg_engine/app/controllers/pg_engine/base_public_controller.rb
pg_rails-7.6.21.pre.7 pg_engine/app/controllers/pg_engine/base_public_controller.rb
pg_rails-7.6.21.pre.6 pg_engine/app/controllers/pg_engine/base_public_controller.rb
pg_rails-7.6.21.pre.5 pg_engine/app/controllers/pg_engine/base_public_controller.rb
pg_rails-7.6.21.pre.4 pg_engine/app/controllers/pg_engine/base_public_controller.rb
pg_rails-7.6.21.pre.3 pg_engine/app/controllers/pg_engine/base_public_controller.rb
pg_rails-7.6.21.pre.2 pg_engine/app/controllers/pg_engine/base_public_controller.rb
pg_rails-7.6.21.pre.1 pg_engine/app/controllers/pg_engine/base_public_controller.rb