Module: SimpleTokenAuth
- Extended by:
- Configuration, Helpers
- Defined in:
- lib/simple_token_auth/helpers.rb,
lib/simple_token_auth.rb,
lib/simple_token_auth/version.rb,
lib/simple_token_auth/configuration.rb,
lib/simple_token_auth/token_authenticatable.rb,
lib/simple_token_auth/authenticate_with_token.rb,
lib/generators/simple_token_auth/install_generator.rb,
lib/generators/simple_token_auth/simple_token_auth_generator.rb
Overview
Usage:
class ApplicationController
include SimpleTokenAuth::AuthenticateWithToken
end
class UserController < ApplicationController
prepend_before_action :authenticate_user_from_token!
end
Defined Under Namespace
Modules: AuthenticateWithToken, Configuration, Generators, Helpers, TokenAuthenticatable
Constant Summary collapse
- VERSION =
"0.0.4"
Class Method Summary collapse
- .after_authenticated(scope, controller) ⇒ Object
- .compare_token(a, b) ⇒ Object
- .find_scope(scope_class, token) ⇒ Object
- .generate_authentication_token ⇒ Object
Methods included from Configuration
Methods included from Helpers
friendly_token, secure_compare
Class Method Details
.after_authenticated(scope, controller) ⇒ Object
21 22 23 |
# File 'lib/simple_token_auth.rb', line 21 def after_authenticated(scope, controller) after_authenticated_strategy.(scope, controller) end |
.compare_token(a, b) ⇒ Object
9 10 11 |
# File 'lib/simple_token_auth.rb', line 9 def compare_token(a, b) compare_token_strategy.(a, b) end |
.find_scope(scope_class, token) ⇒ Object
17 18 19 |
# File 'lib/simple_token_auth.rb', line 17 def find_scope(scope_class, token) find_scope_strategy.(scope_class, token) end |
.generate_authentication_token ⇒ Object
13 14 15 |
# File 'lib/simple_token_auth.rb', line 13 def generate_authentication_token generate_authentication_token_strategy.() end |