module RailsJwtAuth

Constants

InvalidJwtPayload
NotConfirmationsUrl
NotInvitationsUrl
NotResetPasswordsUrl
NotUnlockUrl
VERSION

Public Class Methods

friendly_token(length = 24) click to toggle source

Thanks to github.com/heartcombo/devise/blob/master/lib/devise.rb#L496

# File lib/rails_jwt_auth.rb, line 110
def self.friendly_token(length = 24)
  # To calculate real characters, we must perform this operation.
  # See SecureRandom.urlsafe_base64
  rlength = (length * 3 / 4) - 1
  SecureRandom.urlsafe_base64(rlength, true).tr('lIO0', 'sxyz')
end
mailer() click to toggle source
# File lib/rails_jwt_auth.rb, line 101
def self.mailer
  mailer_name.constantize
end
model() click to toggle source
# File lib/rails_jwt_auth.rb, line 97
def self.model
  model_name.constantize
end
send_email(method, user) click to toggle source
# File lib/rails_jwt_auth.rb, line 117
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| ... } click to toggle source
# File lib/rails_jwt_auth.rb, line 93
def self.setup
  yield self
end
table_name() click to toggle source
# File lib/rails_jwt_auth.rb, line 105
def self.table_name
  model_name.underscore.pluralize
end