module Authenticatable

Authenticatable is an authentication solution for Rails. All related modules, classes and methods will be namespaced under the namespace ‘Authenticatable’:

rubocop:disable Layout/EmptyLinesAroundAttributeAccessor

Constants

VERSION

Attributes

scopes[R]

Public Class Methods

add_scope(resource, options = {}) click to toggle source

Add a authenticatable model to list of scopes. It could be for example :users, :admins, :subscribers or any other model that should be authenticatable.

# File lib/authenticatable.rb, line 92
def add_scope(resource, options = {})
  scope = Authenticatable::Scope.new(resource, options)
  @scopes[scope.singular_name.to_sym] = scope

  # Define helpers like current_{scope}, authenticate_{scope}!
  # {scope}_signed_in? etc for the given scope that can be accessed from all controllers.
  Authenticatable::Controllers::Helpers.define_helpers(scope.singular_name)

  scope
end
reset_default_values!() click to toggle source
# File lib/authenticatable.rb, line 86
def reset_default_values!
  remove_instance_variable :@config
end