Sha256: 8bdcadf36ef0ac78631b40de14d8894bbb75074f360063929268fb4e2c16ab02

Contents?: true

Size: 511 Bytes

Versions: 14

Compression:

Stored size: 511 Bytes

Contents

module PhcdevworksAccountsAuth0
  module ApplicationHelper

    def user_signed_in?
      session['userinfo'].present?
    end

    def authenticate_user!
      if user_signed_in?
        @current_user = session['userinfo']
      else
        redirect_to root_path
      end
    end

    def current_user
      @current_user
    end

    def reset_session
      session['userinfo'] = nil if session['userinfo'].present?
    end

    def current_user
      @current_user = session['userinfo']
    end

  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
phcdevworks_accounts_auth0-1.1.3b app/helpers/phcdevworks_accounts_auth0/application_helper.rb
phcdevworks_accounts_auth0-1.1.2b app/helpers/phcdevworks_accounts_auth0/application_helper.rb
phcdevworks_accounts_auth0-1.1.1b app/helpers/phcdevworks_accounts_auth0/application_helper.rb
phcdevworks_accounts_auth0-1.1.0b app/helpers/phcdevworks_accounts_auth0/application_helper.rb
phcdevworks_accounts_auth0-1.0.1b app/helpers/phcdevworks_accounts_auth0/application_helper.rb
phcdevworks_accounts_auth0-1.0.0b app/helpers/phcdevworks_accounts_auth0/application_helper.rb
phcdevworks_accounts_auth0-0.11.0 app/helpers/phcdevworks_accounts_auth0/application_helper.rb
phcdevworks_accounts_auth0-0.10.0 app/helpers/phcdevworks_accounts_auth0/application_helper.rb
phcdevworks_accounts_auth0-0.9.0 app/helpers/phcdevworks_accounts_auth0/application_helper.rb
phcdevworks_accounts_auth0-0.8.0 app/helpers/phcdevworks_accounts_auth0/application_helper.rb
phcdevworks_accounts_auth0-0.7.0 app/helpers/phcdevworks_accounts_auth0/application_helper.rb
phcdevworks_accounts_auth0-0.6.0 app/helpers/phcdevworks_accounts_auth0/application_helper.rb
phcdevworks_accounts_auth0-0.5.0 app/helpers/phcdevworks_accounts_auth0/application_helper.rb
phcdevworks_accounts_auth0-0.4.0 app/helpers/phcdevworks_accounts_auth0/application_helper.rb