Module: JwtAuthEngine
- Defined in:
- lib/jwt_auth_engine.rb,
lib/jwt_auth_engine/engine.rb,
lib/jwt_auth_engine/errors.rb,
lib/jwt_auth_engine/version.rb,
lib/jwt_auth_engine/constants.rb,
lib/jwt_auth_engine/configuration.rb,
app/services/jwt_auth_engine/base_service.rb,
app/services/jwt_auth_engine/login_service.rb,
app/services/jwt_auth_engine/token_service.rb,
app/services/jwt_auth_engine/signup_service.rb,
app/controllers/jwt_auth_engine/ping_controller.rb,
app/controllers/jwt_auth_engine/tokens_controller.rb,
app/controllers/concerns/jwt_auth_engine/rescuable.rb,
app/services/jwt_auth_engine/refresh_token_service.rb,
app/controllers/jwt_auth_engine/profiles_controller.rb,
app/controllers/jwt_auth_engine/sessions_controller.rb,
app/controllers/concerns/jwt_auth_engine/tokenizable.rb,
app/controllers/jwt_auth_engine/passwords_controller.rb,
app/services/jwt_auth_engine/change_password_service.rb,
app/controllers/concerns/jwt_auth_engine/serializable.rb,
app/controllers/jwt_auth_engine/application_controller.rb,
app/controllers/concerns/jwt_auth_engine/authenticatable.rb,
app/controllers/jwt_auth_engine/registrations_controller.rb,
lib/generators/jwt_auth_engine/install/install_generator.rb,
app/controllers/concerns/jwt_auth_engine/response_renderable.rb,
sig/jwt_auth_engine.rbs
Overview
Public configuration and model-resolution API for the auth engine.
Defined Under Namespace
Modules: Authenticatable, Constants, Generators, Rescuable, ResponseRenderable, Serializable, Tokenizable
Classes: ApplicationController, AuthModelNotFound, BaseService, ChangePasswordService, Configuration, Engine, Error, InvalidAuthModel, InvalidToken, InvalidTokenType, LoginService, MissingSecretKey, PasswordsController, PingController, ProfilesController, RefreshTokenService, RegistrationsController, SessionsController, SignupService, TokenExpired, TokenService, TokensController
Constant Summary
collapse
- VERSION =
'1.0.0'
Class Method Summary
collapse
Class Method Details
.auth_model_class ⇒ Object
20
21
22
23
24
25
|
# File 'lib/jwt_auth_engine.rb', line 20
def auth_model_class
configured_auth_model = configuration.auth_model.to_s
return @resolved_auth_model_class if cached_auth_model_class?(configured_auth_model)
resolve_and_cache_auth_model(configured_auth_model)
end
|
.auth_model_name ⇒ Object
27
28
29
|
# File 'lib/jwt_auth_engine.rb', line 27
def auth_model_name
auth_model_class.name.underscore.to_sym
end
|
.auth_model_token_payload_key ⇒ Object
51
52
53
|
# File 'lib/jwt_auth_engine.rb', line 51
def auth_model_token_payload_key
:"#{auth_model_name}_#{auth_model_class.primary_key}"
end
|
.configuration ⇒ Object
12
13
14
|
# File 'lib/jwt_auth_engine.rb', line 12
def configuration
@configuration ||= Configuration.new
end
|
16
17
18
|
# File 'lib/jwt_auth_engine.rb', line 16
def configure
yield(configuration)
end
|
.current_password_field ⇒ Object
43
44
45
|
# File 'lib/jwt_auth_engine.rb', line 43
def current_password_field
:"current_#{password_field}"
end
|
.identifier_field ⇒ Object
31
32
33
|
# File 'lib/jwt_auth_engine.rb', line 31
def identifier_field
configuration.identifier_field.to_sym
end
|
.new_password_field ⇒ Object
47
48
49
|
# File 'lib/jwt_auth_engine.rb', line 47
def new_password_field
:"new_#{password_field}"
end
|
.password_digest_field ⇒ Object
39
40
41
|
# File 'lib/jwt_auth_engine.rb', line 39
def password_digest_field
:"#{password_field}_digest"
end
|
.password_field ⇒ Object
35
36
37
|
# File 'lib/jwt_auth_engine.rb', line 35
def password_field
configuration.password_field.to_sym
end
|