Module: RailsJwtAuth
- Defined in:
- lib/rails_jwt_auth.rb,
lib/rails_jwt_auth/engine.rb,
lib/rails_jwt_auth/session.rb,
lib/rails_jwt_auth/version.rb,
lib/rails_jwt_auth/jwt_manager.rb,
lib/rails_jwt_auth/spec_helpers.rb,
app/models/concerns/rails_jwt_auth/lockable.rb,
app/models/concerns/rails_jwt_auth/invitable.rb,
app/models/concerns/rails_jwt_auth/trackable.rb,
app/models/concerns/rails_jwt_auth/confirmable.rb,
app/models/concerns/rails_jwt_auth/recoverable.rb,
app/controllers/rails_jwt_auth/profiles_controller.rb,
app/controllers/rails_jwt_auth/sessions_controller.rb,
app/models/concerns/rails_jwt_auth/authenticatable.rb,
app/controllers/concerns/rails_jwt_auth/params_helper.rb,
app/controllers/concerns/rails_jwt_auth/render_helper.rb,
app/controllers/rails_jwt_auth/invitations_controller.rb,
app/controllers/rails_jwt_auth/confirmations_controller.rb,
app/controllers/rails_jwt_auth/registrations_controller.rb,
app/controllers/rails_jwt_auth/reset_passwords_controller.rb,
app/controllers/rails_jwt_auth/unlock_accounts_controller.rb,
app/controllers/concerns/rails_jwt_auth/authenticable_helper.rb
Defined Under Namespace
Modules: AuthenticableHelper, Authenticatable, Confirmable, Invitable, JwtManager, Lockable, ParamsHelper, Recoverable, RenderHelper, SpecHelpers, Trackable
Classes: ConfirmationsController, Engine, InstallGenerator, InvitationsController, Mailer, MigrateGenerator, ProfilesController, RegistrationsController, ResetPasswordsController, Session, SessionsController, UnlockAccountsController
Constant Summary
collapse
- NotConfirmationsUrl =
Class.new(StandardError)
- NotInvitationsUrl =
Class.new(StandardError)
- NotResetPasswordsUrl =
Class.new(StandardError)
- NotUnlockUrl =
Class.new(StandardError)
- InvalidJwtPayload =
Class.new(StandardError)
- VERSION =
'2.0.1'
- NotAuthorized =
Class.new(StandardError)
Class Method Summary
collapse
Class Method Details
.friendly_token(length = 24) ⇒ Object
109
110
111
112
113
114
|
# File 'lib/rails_jwt_auth.rb', line 109
def self.friendly_token(length = 24)
rlength = (length * 3 / 4) - 1
SecureRandom.urlsafe_base64(rlength, true).tr('lIO0', 'sxyz')
end
|
.mailer ⇒ Object
100
101
102
|
# File 'lib/rails_jwt_auth.rb', line 100
def self.mailer
mailer_name.constantize
end
|
.model ⇒ Object
96
97
98
|
# File 'lib/rails_jwt_auth.rb', line 96
def self.model
model_name.constantize
end
|
.send_email(method, user) ⇒ Object
116
117
118
119
|
# File 'lib/rails_jwt_auth.rb', line 116
def self.send_email(method, user)
mailer = RailsJwtAuth.mailer.with(user_id: user.id.to_s).public_send(method)
RailsJwtAuth.deliver_later ? mailer.deliver_later : mailer.deliver
end
|
.setup {|_self| ... } ⇒ Object
92
93
94
|
# File 'lib/rails_jwt_auth.rb', line 92
def self.setup
yield self
end
|
.table_name ⇒ Object
104
105
106
|
# File 'lib/rails_jwt_auth.rb', line 104
def self.table_name
model_name.underscore.pluralize
end
|