repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
renderedtext/base-app | https://github.com/renderedtext/base-app/blob/a90c8bb8649cff2b05de8ae59ea07b40cde392bd/spec/models/user_spec.rb | spec/models/user_spec.rb | require 'spec_helper'
describe User do
it { should have_db_column(:email).of_type(:string) }
it { should have_db_column(:encrypted_password).of_type(:string) }
it { should have_db_column(:reset_password_token).of_type(:string) }
it { should have_db_column(:remember_created_at).of_type(:datetime) }
it { shou... | ruby | MIT | a90c8bb8649cff2b05de8ae59ea07b40cde392bd | 2026-01-04T17:58:16.689142Z | false |
renderedtext/base-app | https://github.com/renderedtext/base-app/blob/a90c8bb8649cff2b05de8ae59ea07b40cde392bd/config/application.rb | config/application.rb | require File.expand_path('../boot', __FILE__)
require 'rails/all'
# Require the gems listed in Gemdile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(:default, Rails.env)
module BaseApp
class Application < Rails::Application
# Settings in config/environments/* take... | ruby | MIT | a90c8bb8649cff2b05de8ae59ea07b40cde392bd | 2026-01-04T17:58:16.689142Z | false |
renderedtext/base-app | https://github.com/renderedtext/base-app/blob/a90c8bb8649cff2b05de8ae59ea07b40cde392bd/config/environment.rb | config/environment.rb | # Load the rails application
require File.expand_path('../application', __FILE__)
# Initialize the rails application
BaseApp::Application.initialize!
| ruby | MIT | a90c8bb8649cff2b05de8ae59ea07b40cde392bd | 2026-01-04T17:58:16.689142Z | false |
renderedtext/base-app | https://github.com/renderedtext/base-app/blob/a90c8bb8649cff2b05de8ae59ea07b40cde392bd/config/routes.rb | config/routes.rb | BaseApp::Application.routes.draw do
devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" }
get "pages/index"
get "/admin" => "admin/base#index", :as => "admin"
namespace "admin" do
resources :users
end
root :to => "pages#index"
end
| ruby | MIT | a90c8bb8649cff2b05de8ae59ea07b40cde392bd | 2026-01-04T17:58:16.689142Z | false |
renderedtext/base-app | https://github.com/renderedtext/base-app/blob/a90c8bb8649cff2b05de8ae59ea07b40cde392bd/config/boot.rb | config/boot.rb | # Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
| ruby | MIT | a90c8bb8649cff2b05de8ae59ea07b40cde392bd | 2026-01-04T17:58:16.689142Z | false |
renderedtext/base-app | https://github.com/renderedtext/base-app/blob/a90c8bb8649cff2b05de8ae59ea07b40cde392bd/config/initializers/session_store.rb | config/initializers/session_store.rb | # Be sure to restart your server when you modify this file.
BaseApp::Application.config.session_store :cookie_store, :key => '_base-app_session'
# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the session table with "rai... | ruby | MIT | a90c8bb8649cff2b05de8ae59ea07b40cde392bd | 2026-01-04T17:58:16.689142Z | false |
renderedtext/base-app | https://github.com/renderedtext/base-app/blob/a90c8bb8649cff2b05de8ae59ea07b40cde392bd/config/initializers/devise.rb | config/initializers/devise.rb | # Use this hook to configure devise mailer, warden hooks and so forth. The first
# four configuration values can also be set straight in your models.
Devise.setup do |config|
# ==> Mailer Configuration
# Configure the e-mail address which will be shown in DeviseMailer.
config.mailer_sender = "please-change-me@con... | ruby | MIT | a90c8bb8649cff2b05de8ae59ea07b40cde392bd | 2026-01-04T17:58:16.689142Z | false |
renderedtext/base-app | https://github.com/renderedtext/base-app/blob/a90c8bb8649cff2b05de8ae59ea07b40cde392bd/config/initializers/inflections.rb | config/initializers/inflections.rb | # Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format
# (all these examples are active by default):
# ActiveSupport::Inflector.inflections do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^(ox)en/i, '\1'
# inflect.irregular 'person', ... | ruby | MIT | a90c8bb8649cff2b05de8ae59ea07b40cde392bd | 2026-01-04T17:58:16.689142Z | false |
renderedtext/base-app | https://github.com/renderedtext/base-app/blob/a90c8bb8649cff2b05de8ae59ea07b40cde392bd/config/initializers/backtrace_silencers.rb | config/initializers/backtrace_silencers.rb | # Be sure to restart your server when you modify this file.
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
# You can also remove all the silencers if you're trying to debug a probl... | ruby | MIT | a90c8bb8649cff2b05de8ae59ea07b40cde392bd | 2026-01-04T17:58:16.689142Z | false |
renderedtext/base-app | https://github.com/renderedtext/base-app/blob/a90c8bb8649cff2b05de8ae59ea07b40cde392bd/config/initializers/mime_types.rb | config/initializers/mime_types.rb | # Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
# Mime::Type.register_alias "text/html", :iphone
| ruby | MIT | a90c8bb8649cff2b05de8ae59ea07b40cde392bd | 2026-01-04T17:58:16.689142Z | false |
renderedtext/base-app | https://github.com/renderedtext/base-app/blob/a90c8bb8649cff2b05de8ae59ea07b40cde392bd/config/initializers/secret_token.rb | config/initializers/secret_token.rb | # Be sure to restart your server when you modify this file.
# Your secret key for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attac... | ruby | MIT | a90c8bb8649cff2b05de8ae59ea07b40cde392bd | 2026-01-04T17:58:16.689142Z | false |
renderedtext/base-app | https://github.com/renderedtext/base-app/blob/a90c8bb8649cff2b05de8ae59ea07b40cde392bd/config/environments/test.rb | config/environments/test.rb | BaseApp::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test s... | ruby | MIT | a90c8bb8649cff2b05de8ae59ea07b40cde392bd | 2026-01-04T17:58:16.689142Z | false |
renderedtext/base-app | https://github.com/renderedtext/base-app/blob/a90c8bb8649cff2b05de8ae59ea07b40cde392bd/config/environments/development.rb | config/environments/development.rb | BaseApp::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web s... | ruby | MIT | a90c8bb8649cff2b05de8ae59ea07b40cde392bd | 2026-01-04T17:58:16.689142Z | false |
renderedtext/base-app | https://github.com/renderedtext/base-app/blob/a90c8bb8649cff2b05de8ae59ea07b40cde392bd/config/environments/production.rb | config/environments/production.rb | BaseApp::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both thread web serv... | ruby | MIT | a90c8bb8649cff2b05de8ae59ea07b40cde392bd | 2026-01-04T17:58:16.689142Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/app/controllers/unauthorized_controller.rb | app/controllers/unauthorized_controller.rb | class UnauthorizedController < ActionController::Metal
def self.call(env)
@respond ||= action(:respond)
@respond.call(env)
end
def respond
self.response_body = "Unauthorized Action"
self.status = :unauthorized
end
end
| ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/app/controllers/concerns/rails_jwt_auth/params_helper.rb | app/controllers/concerns/rails_jwt_auth/params_helper.rb | module RailsJwtAuth
module ParamsHelper
private
def registration_create_params
params.require(RailsJwtAuth.model_name.underscore).permit(
RailsJwtAuth.auth_field_name, :password, :password_confirmation
)
end
def confirmation_create_params
params.require(:confirmation).permi... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/app/controllers/concerns/rails_jwt_auth/render_helper.rb | app/controllers/concerns/rails_jwt_auth/render_helper.rb | module RailsJwtAuth
module RenderHelper
def render_session(jwt, user)
auth_field = RailsJwtAuth.auth_field_name
render json: {session: {jwt: jwt, auth_field => user[auth_field]}}, status: 201
end
def render_registration(resource)
render json: resource, root: true, status: 201
end
... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/app/controllers/concerns/rails_jwt_auth/authenticable_helper.rb | app/controllers/concerns/rails_jwt_auth/authenticable_helper.rb | module RailsJwtAuth
NotAuthorized = Class.new(StandardError)
module AuthenticableHelper
def current_user
@current_user
end
def jwt_payload
@jwt_payload
end
def signed_in?
!current_user.nil?
end
def get_jwt_from_request
request.env['HTTP_AUTHORIZATION']&.split&... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/app/controllers/rails_jwt_auth/profiles_controller.rb | app/controllers/rails_jwt_auth/profiles_controller.rb | module RailsJwtAuth
class ProfilesController < ApplicationController
include AuthenticableHelper
include ParamsHelper
include RenderHelper
PASSWORD_PARAMS = %i[current_password password password_confirmation].freeze
before_action :authenticate!
def show
render_profile current_user
... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/app/controllers/rails_jwt_auth/unlock_accounts_controller.rb | app/controllers/rails_jwt_auth/unlock_accounts_controller.rb | module RailsJwtAuth
class UnlockAccountsController < ApplicationController
include ParamsHelper
include RenderHelper
def update
return render_404 unless
params[:id] &&
(user = RailsJwtAuth.model.where(unlock_token: params[:id]).first)
user.unlock_access ? render_204 : render_... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/app/controllers/rails_jwt_auth/invitations_controller.rb | app/controllers/rails_jwt_auth/invitations_controller.rb | module RailsJwtAuth
class InvitationsController < ApplicationController
include AuthenticableHelper
include ParamsHelper
include RenderHelper
before_action :authenticate!, only: [:create]
before_action :set_user_from_token, only: [:show, :update]
# used to verify token
def show
ret... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/app/controllers/rails_jwt_auth/reset_passwords_controller.rb | app/controllers/rails_jwt_auth/reset_passwords_controller.rb | module RailsJwtAuth
class ResetPasswordsController < ApplicationController
include ParamsHelper
include RenderHelper
before_action :set_user_from_token, only: [:show, :update]
before_action :set_user_from_email, only: [:create]
# used to verify token
def show
return render_404 unless @... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/app/controllers/rails_jwt_auth/registrations_controller.rb | app/controllers/rails_jwt_auth/registrations_controller.rb | module RailsJwtAuth
class RegistrationsController < ApplicationController
include ParamsHelper
include RenderHelper
def create
user = RailsJwtAuth.model.new(registration_create_params)
user.save ? render_registration(user) : render_422(user.errors.details)
end
end
end
| ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/app/controllers/rails_jwt_auth/confirmations_controller.rb | app/controllers/rails_jwt_auth/confirmations_controller.rb | module RailsJwtAuth
class ConfirmationsController < ApplicationController
include ParamsHelper
include RenderHelper
before_action :set_user_from_token, only: [:show, :update]
before_action :set_user_from_email, only: [:create]
# used to verify token
def show
return render_404 unless @u... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/app/controllers/rails_jwt_auth/sessions_controller.rb | app/controllers/rails_jwt_auth/sessions_controller.rb | module RailsJwtAuth
class SessionsController < ApplicationController
include AuthenticableHelper
include ParamsHelper
include RenderHelper
def create
se = Session.new(session_create_params)
if se.generate!(request)
render_session se.jwt, se.user
else
render_422 se.e... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/app/models/concerns/rails_jwt_auth/lockable.rb | app/models/concerns/rails_jwt_auth/lockable.rb | module RailsJwtAuth
module Lockable
BOTH_UNLOCK_STRATEGIES = %i[time email].freeze
def self.included(base)
base.class_eval do
if defined?(Mongoid) && ancestors.include?(Mongoid::Document)
field :failed_attempts, type: Integer
field :unlock_token, type: Str... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/app/models/concerns/rails_jwt_auth/invitable.rb | app/models/concerns/rails_jwt_auth/invitable.rb | module RailsJwtAuth
module Invitable
def self.included(base)
base.extend ClassMethods
base.class_eval do
if defined?(Mongoid) && ancestors.include?(Mongoid::Document)
# include GlobalID::Identification to use deliver_later method
# http://edgeguides.rubyonrails.org/active_j... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/app/models/concerns/rails_jwt_auth/authenticatable.rb | app/models/concerns/rails_jwt_auth/authenticatable.rb | include ActiveModel::SecurePassword
module RailsJwtAuth
module Authenticatable
def self.included(base)
base.extend(ClassMethods)
base.class_eval do
if defined?(Mongoid) && ancestors.include?(Mongoid::Document)
field :password_digest, type: String
field :auth_tokens, type:... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/app/models/concerns/rails_jwt_auth/recoverable.rb | app/models/concerns/rails_jwt_auth/recoverable.rb | module RailsJwtAuth
module Recoverable
def self.included(base)
base.class_eval do
if defined?(Mongoid) && base.ancestors.include?(Mongoid::Document)
# include GlobalID::Identification to use deliver_later method
# http://edgeguides.rubyonrails.org/active_job_basics.html#globalid
... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/app/models/concerns/rails_jwt_auth/confirmable.rb | app/models/concerns/rails_jwt_auth/confirmable.rb | # frozen_string_literal: true
module RailsJwtAuth
module Confirmable
def self.included(base)
base.class_eval do
if defined?(Mongoid) && ancestors.include?(Mongoid::Document)
# include GlobalID::Identification to use deliver_later method
# http://edgeguides.rubyonrails.org/active... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/app/models/concerns/rails_jwt_auth/trackable.rb | app/models/concerns/rails_jwt_auth/trackable.rb | module RailsJwtAuth
module Trackable
def track_session_info(request)
return unless request
self.last_sign_in_at = Time.current
self.last_sign_in_ip = request.respond_to?(:remote_ip) ? request.remote_ip : request.ip
end
def update_tracked_request_info(request)
return unless reques... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/app/mailers/rails_jwt_auth/mailer.rb | app/mailers/rails_jwt_auth/mailer.rb | if defined?(ActionMailer)
class RailsJwtAuth::Mailer < ApplicationMailer
default from: RailsJwtAuth.mailer_sender
before_action do
@user = RailsJwtAuth.model.find(params[:user_id])
@to = @user[RailsJwtAuth.email_field_name]
@subject = I18n.t("rails_jwt_auth.mailer.#{action_name}.subject")
... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/rails_helper.rb | spec/rails_helper.rb | # This file is copied to spec/ when you run 'rails generate rspec:install'
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../dummy/config/environment', __FILE__)
# Prevent database truncation if the environment is production
abort('The Rails environment is running in production mode!') if Rails.env.production?
r... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/spec_helper.rb | spec/spec_helper.rb | # This file was generated by the `rails generate rspec:install` command. Conventionally, all
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
# The generated `.rspec` file contains `--require spec_helper` which will cause
# this file to always be loaded, without a need to explicitly require ... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/factories/sequences.rb | spec/factories/sequences.rb | FactoryBot.define do
sequence :email do |n|
"user#{n}@email.com"
end
end
| ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/factories/mongoid_user.rb | spec/factories/mongoid_user.rb | FactoryBot.define do
factory :mongoid_unconfirmed_user, class: MongoidUser do
email
password { '12345678' }
sequence(:username) { |n| "user_#{n}" }
end
factory :mongoid_user, parent: :mongoid_unconfirmed_user do
before :create do |user|
user.skip_confirmation
end
end
factory :mongo... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/factories/active_record_user.rb | spec/factories/active_record_user.rb | FactoryBot.define do
factory :active_record_unconfirmed_user, class: ActiveRecordUser do
email
password { '12345678' }
sequence(:username) { |n| "user_#{n}" }
end
factory :active_record_user, parent: :active_record_unconfirmed_user do
before :create do |user|
user.skip_confirmation
end
... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/controllers/registrations_controller_spec.rb | spec/controllers/registrations_controller_spec.rb | require 'rails_helper'
describe RailsJwtAuth::RegistrationsController do
%w[ActiveRecord Mongoid].each do |orm|
context "when use #{orm}" do
before(:all) { initialize_orm(orm) }
before do
allow_any_instance_of(RailsJwtAuth.model)
.to(receive(:send_confirmation_instructions).and_ret... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/controllers/invitations_controller_spec.rb | spec/controllers/invitations_controller_spec.rb | require 'rails_helper'
RSpec.describe RailsJwtAuth::InvitationsController do
%w[ActiveRecord Mongoid].each do |orm|
context "Using #{orm}" do
before(:all) { initialize_orm(orm) }
let(:invited_user) { RailsJwtAuth.model.invite email: 'valid@example.com' }
let(:json) { JSON.parse(response.body) ... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/controllers/sessions_controller_spec.rb | spec/controllers/sessions_controller_spec.rb | require 'rails_helper'
require 'rails_jwt_auth/jwt_manager'
describe RailsJwtAuth::SessionsController do
%w[ActiveRecord Mongoid].each do |orm|
context "when use #{orm}" do
before(:all) { initialize_orm(orm) }
let(:json) { JSON.parse(response.body) }
let(:user) { FactoryBot.create("#{orm.under... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/controllers/reset_passwords_controller_spec.rb | spec/controllers/reset_passwords_controller_spec.rb | require 'rails_helper'
describe RailsJwtAuth::ResetPasswordsController do
%w[ActiveRecord Mongoid].each do |orm|
context "when use #{orm}" do
before(:all) { initialize_orm(orm) }
let(:json) { JSON.parse(response.body) }
let(:user) { FactoryBot.create("#{orm.underscore}_user", password: '123456... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/controllers/confirmations_controller_spec.rb | spec/controllers/confirmations_controller_spec.rb | require 'rails_helper'
describe RailsJwtAuth::ConfirmationsController do
%w[ActiveRecord Mongoid].each do |orm|
context "when use #{orm}" do
before(:all) { initialize_orm(orm) }
let(:json) { JSON.parse(response.body) }
let!(:user) { FactoryBot.create("#{orm.underscore}_unconfirmed_user") }
... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/controllers/unlock_accounts_controller_spec.rb | spec/controllers/unlock_accounts_controller_spec.rb | require 'rails_helper'
describe RailsJwtAuth::UnlockAccountsController do
%w[ActiveRecord Mongoid].each do |orm|
context "when use #{orm}" do
before(:all) { initialize_orm(orm) }
let(:user) {
FactoryBot.create(
"#{orm.underscore}_user",
locked_at: 2.minutes.ago,
... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/controllers/profiles_controller_spec.rb | spec/controllers/profiles_controller_spec.rb | require 'rails_helper'
include RailsJwtAuth::SpecHelpers
RSpec.describe RailsJwtAuth::ProfilesController do
%w[ActiveRecord Mongoid].each do |orm|
context "Using #{orm}" do
before(:all) { initialize_orm(orm) }
let(:password) { '12345678' }
let(:new_password) { 'new12345678' }
let(:json... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/controllers/concerns/authenticable_helper_spec.rb | spec/controllers/concerns/authenticable_helper_spec.rb | require 'rails_helper'
require 'rails_jwt_auth/jwt_manager'
describe RailsJwtAuth::AuthenticableHelper, type: :helper do
describe '#current_user' do
it 'returns current user' do
@current_user = {name: 'name'}
expect(helper.current_user).to eq(@current_user)
end
end
describe '#jwt_payload' do... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/models/concerns/confirmable_spec.rb | spec/models/concerns/confirmable_spec.rb | require 'rails_helper'
describe RailsJwtAuth::Confirmable do
%w[ActiveRecord Mongoid].each do |orm|
context "when use #{orm}" do
before(:all) { initialize_orm(orm) }
let(:password) { '12345678' }
let(:user) { FactoryBot.create("#{orm.underscore}_user", password: password) }
let(:unconfir... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/models/concerns/lockable_spec.rb | spec/models/concerns/lockable_spec.rb | require 'rails_helper'
describe RailsJwtAuth::Lockable do
%w[ActiveRecord Mongoid].each do |orm|
context "when use #{orm}" do
before(:each) { initialize_orm(orm) }
let(:user) { FactoryBot.create("#{orm.underscore}_user") }
let(:locked_user) {
FactoryBot.create(
"#{orm.unders... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/models/concerns/trackable_spec.rb | spec/models/concerns/trackable_spec.rb | require 'rails_helper'
describe RailsJwtAuth::Trackable do
%w[ActiveRecord Mongoid].each do |orm|
context "when use #{orm}" do
before(:all) { initialize_orm(orm) }
let(:user) do
FactoryBot.create(
"#{orm.underscore}_user",
last_sign_in_at: Time.current,
last_sig... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/models/concerns/authenticatable_spec.rb | spec/models/concerns/authenticatable_spec.rb | require 'rails_helper'
describe RailsJwtAuth::Authenticatable do
%w[ActiveRecord Mongoid].each do |orm|
context "when use #{orm}" do
before(:all) { initialize_orm(orm) }
let(:user) { FactoryBot.create("#{orm.underscore}_user", auth_tokens: %w[abcd]) }
describe '#attributes' do
it { ex... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/models/concerns/recoverable_spec.rb | spec/models/concerns/recoverable_spec.rb | require 'rails_helper'
describe RailsJwtAuth::Recoverable do
%w(ActiveRecord Mongoid).each do |orm|
context "when use #{orm}" do
before(:all) { initialize_orm(orm) }
let(:user) { FactoryBot.create("#{orm.underscore}_user") }
describe '#attributes' do
it { expect(user).to respond_to(:r... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/models/concerns/invitable_spec.rb | spec/models/concerns/invitable_spec.rb | require 'rails_helper'
describe RailsJwtAuth::Invitable do
%w[ActiveRecord Mongoid].each do |orm|
context "Using #{orm}" do
before(:all) { initialize_orm(orm) }
before(:each) { ActionMailer::Base.deliveries.clear }
let(:pass) { 'new_password' }
let(:email) { 'valid@email.com' }
let... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/dummy/app/jobs/application_job.rb | spec/dummy/app/jobs/application_job.rb | class ApplicationJob < ActiveJob::Base
end
| ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/dummy/app/helpers/application_helper.rb | spec/dummy/app/helpers/application_helper.rb | module ApplicationHelper
end
| ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/dummy/app/controllers/application_controller.rb | spec/dummy/app/controllers/application_controller.rb | class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
end
| ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/dummy/app/models/application_record.rb | spec/dummy/app/models/application_record.rb | class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
end
| ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/dummy/app/models/mongoid_user.rb | spec/dummy/app/models/mongoid_user.rb | class MongoidUser
include Mongoid::Document
include RailsJwtAuth::Authenticatable
include RailsJwtAuth::Confirmable
include RailsJwtAuth::Recoverable
include RailsJwtAuth::Trackable
include RailsJwtAuth::Invitable
include RailsJwtAuth::Lockable
attr_accessor :email_confirmation
field :username, ... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/dummy/app/models/active_record_user.rb | spec/dummy/app/models/active_record_user.rb | class ActiveRecordUser < ApplicationRecord
include RailsJwtAuth::Authenticatable
include RailsJwtAuth::Confirmable
include RailsJwtAuth::Recoverable
include RailsJwtAuth::Trackable
include RailsJwtAuth::Invitable
include RailsJwtAuth::Lockable
attr_accessor :email_confirmation
validates :email, presen... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/dummy/app/mailers/application_mailer.rb | spec/dummy/app/mailers/application_mailer.rb | class ApplicationMailer < ActionMailer::Base
default from: 'from@example.com'
layout 'mailer'
end
| ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/dummy/app/channels/application_cable/channel.rb | spec/dummy/app/channels/application_cable/channel.rb | module ApplicationCable
class Channel < ActionCable::Channel::Base
end
end
| ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/dummy/app/channels/application_cable/connection.rb | spec/dummy/app/channels/application_cable/connection.rb | module ApplicationCable
class Connection < ActionCable::Connection::Base
end
end
| ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/dummy/db/schema.rb | spec/dummy/db/schema.rb | # This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# dat... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/dummy/config/application.rb | spec/dummy/config/application.rb | require_relative 'boot'
require "rails"
# Pick the frameworks you want:
require "active_model/railtie"
require "active_job/railtie"
require "active_record/railtie"
require "active_storage/engine"
require "action_controller/railtie"
require "action_mailer/railtie"
require "action_view/railtie"
require "action_cable/eng... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/dummy/config/environment.rb | spec/dummy/config/environment.rb | # Load the Rails application.
require_relative 'application'
# Initialize the Rails application.
Rails.application.initialize!
| ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/dummy/config/puma.rb | spec/dummy/config/puma.rb | # Puma can serve each request in a thread from an internal thread pool.
# The `threads` method setting takes two numbers: a minimum and maximum.
# Any libraries that use thread pools should be configured to match
# the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum; this matches... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/dummy/config/routes.rb | spec/dummy/config/routes.rb | Rails.application.routes.draw do
resource :session, controller: 'rails_jwt_auth/sessions', only: %i[create destroy]
resource :registration, controller: 'rails_jwt_auth/registrations', only: %i[create]
resource :profile, controller: 'rails_jwt_auth/profiles', only: %i[show update] do
collection do
put :e... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/dummy/config/spring.rb | spec/dummy/config/spring.rb | %w[
.ruby-version
.rbenv-vars
tmp/restart.txt
tmp/caching-dev.txt
].each { |path| Spring.watch(path) }
| ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/dummy/config/boot.rb | spec/dummy/config/boot.rb | # Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../Gemfile', __dir__)
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
$LOAD_PATH.unshift File.expand_path('../../../lib', __dir__)
| ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/dummy/config/initializers/content_security_policy.rb | spec/dummy/config/initializers/content_security_policy.rb | # Be sure to restart your server when you modify this file.
# Define an application-wide content security policy
# For further information see the following documentation
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
# Rails.application.config.content_security_policy do |policy|
... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/dummy/config/initializers/filter_parameter_logging.rb | spec/dummy/config/initializers/filter_parameter_logging.rb | # Be sure to restart your server when you modify this file.
# Configure sensitive parameters which will be filtered from the log file.
Rails.application.config.filter_parameters += [:password]
| ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/dummy/config/initializers/application_controller_renderer.rb | spec/dummy/config/initializers/application_controller_renderer.rb | # Be sure to restart your server when you modify this file.
# ActiveSupport::Reloader.to_prepare do
# ApplicationController.renderer.defaults.merge!(
# http_host: 'example.org',
# https: false
# )
# end
| ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/dummy/config/initializers/wrap_parameters.rb | spec/dummy/config/initializers/wrap_parameters.rb | # Be sure to restart your server when you modify this file.
# This file contains settings for ActionController::ParamsWrapper which
# is enabled by default.
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
ActiveSupport.on_load(:action_controller) do
wrap_parameters f... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/dummy/config/initializers/rails_jwt_auth.rb | spec/dummy/config/initializers/rails_jwt_auth.rb | RailsJwtAuth.setup do |config|
# authentication model class name
config.model_name = 'ActiveRecordUser'
# field name used to authentication with password
#config.auth_field_name = 'email'
# define email field name used to send emails
#config.email_field_name = 'email'
# expiration time for generated to... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/dummy/config/initializers/inflections.rb | spec/dummy/config/initializers/inflections.rb | # Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format. Inflections
# are locale specific, and you may define rules for as many different
# locales as you wish. All of these examples are active by default:
# ActiveSupport::Inflector.inflections(:en) do |inflec... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/dummy/config/initializers/cookies_serializer.rb | spec/dummy/config/initializers/cookies_serializer.rb | # Be sure to restart your server when you modify this file.
# Specify a serializer for the signed and encrypted cookie jars.
# Valid options are :json, :marshal, and :hybrid.
Rails.application.config.action_dispatch.cookies_serializer = :json
| ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/dummy/config/initializers/assets.rb | spec/dummy/config/initializers/assets.rb | # Be sure to restart your server when you modify this file.
# Version of your assets, change this if you want to expire all your assets.
# Rails.application.config.assets.version = '1.0'
# Add additional assets to the asset load path.
# Rails.application.config.assets.paths << Emoji.images_path
# Add Yarn node_module... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/dummy/config/initializers/backtrace_silencers.rb | spec/dummy/config/initializers/backtrace_silencers.rb | # Be sure to restart your server when you modify this file.
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
# You can also remove all the silencers if you're trying to debug a probl... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/dummy/config/initializers/mime_types.rb | spec/dummy/config/initializers/mime_types.rb | # Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
| ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/dummy/config/initializers/cors.rb | spec/dummy/config/initializers/cors.rb | # Be sure to restart your server when you modify this file.
# Avoid CORS issues when API is called from the frontend app.
# Handle Cross-Origin Resource Sharing (CORS) in order to accept cross-origin AJAX requests.
# Read more: https://github.com/cyu/rack-cors
# Rails.application.config.middleware.insert_before 0, R... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/dummy/config/environments/test.rb | spec/dummy/config/environments/test.rb | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suit... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/dummy/config/environments/development.rb | spec/dummy/config/environments/development.rb | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web serv... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/dummy/config/environments/production.rb | spec/dummy/config/environments/production.rb | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web serve... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/lib/rails_jwt_auth_spec.rb | spec/lib/rails_jwt_auth_spec.rb | require 'rails_helper'
describe RailsJwtAuth do
before(:all) { initialize_orm('ActiveRecord') }
describe '#send_email' do
let(:unconfirmed_user) { FactoryBot.create(:active_record_unconfirmed_user) }
after { RailsJwtAuth.deliver_later = false }
context 'when deliver_later options is false' do
... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/lib/session_spec.rb | spec/lib/session_spec.rb | require 'rails_helper'
require 'rails_jwt_auth/session'
module RailsJwtAuth
describe Session do
%w[ActiveRecord Mongoid].each do |orm|
context "when use #{orm}" do
before(:all) { initialize_orm(orm) }
let(:pass) { '12345678' }
let(:user) { FactoryBot.create("#{orm.underscore}_user... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/spec/mailers/mailer_spec.rb | spec/mailers/mailer_spec.rb | require 'rails_helper'
RSpec.describe RailsJwtAuth::Mailer, type: :mailer do
%w[ActiveRecord Mongoid].each do |orm|
context "when use #{orm}" do
before(:all) { initialize_orm(orm) }
let(:mail_params) { {user_id: user.id.to_s } }
describe '#confirmation_instructions' do
let(:user) do
... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/lib/rails_jwt_auth.rb | lib/rails_jwt_auth.rb | require 'active_support/core_ext/integer/time'
require 'bcrypt'
require 'rails_jwt_auth/engine'
require 'rails_jwt_auth/jwt_manager'
require 'rails_jwt_auth/session'
module RailsJwtAuth
NotConfirmationsUrl = Class.new(StandardError)
NotInvitationsUrl = Class.new(StandardError)
NotResetPasswordsUrl = Class.new(S... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/lib/rails_jwt_auth/session.rb | lib/rails_jwt_auth/session.rb | module RailsJwtAuth
class Session
attr_reader :user, :errors, :jwt
Errors = Struct.new :details # simulate ActiveModel::Errors
def initialize(params={})
@auth_field_value = (params[RailsJwtAuth.auth_field_name] || '').strip
@auth_field_value.downcase! if RailsJwtAuth.downcase_auth_field
... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/lib/rails_jwt_auth/version.rb | lib/rails_jwt_auth/version.rb | module RailsJwtAuth
VERSION = '2.0.3'
end
| ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/lib/rails_jwt_auth/spec_helpers.rb | lib/rails_jwt_auth/spec_helpers.rb | module RailsJwtAuth
module SpecHelpers
def sign_in(user)
allow_any_instance_of(RailsJwtAuth::AuthenticableHelper)
.to receive(:authenticate!).and_return(true)
allow_any_instance_of(RailsJwtAuth::AuthenticableHelper)
.to receive(:current_user).and_return(user.class.find(user.id))
e... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/lib/rails_jwt_auth/jwt_manager.rb | lib/rails_jwt_auth/jwt_manager.rb | require 'jwt'
module RailsJwtAuth
module JwtManager
def self.secret_key_base
Rails.application.secret_key_base
end
# Encodes and signs JWT Payload with expiration
def self.encode(payload)
raise InvalidJwtPayload unless payload
payload.reverse_merge!(meta)
JWT.encode(payload,... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/lib/rails_jwt_auth/engine.rb | lib/rails_jwt_auth/engine.rb | module RailsJwtAuth
class Engine < ::Rails::Engine
end
end
| ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/lib/generators/rails_jwt_auth/migrate_generator.rb | lib/generators/rails_jwt_auth/migrate_generator.rb | class RailsJwtAuth::MigrateGenerator < Rails::Generators::Base
include Rails::Generators::Migration
source_root File.expand_path('../templates', __dir__)
def self.next_migration_number(_dir)
Time.current.strftime('%Y%m%d%H%M%S')
end
def create_initializer_file
migration_template 'migration.rb', "db... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/lib/generators/rails_jwt_auth/install_generator.rb | lib/generators/rails_jwt_auth/install_generator.rb | class RailsJwtAuth::InstallGenerator < Rails::Generators::Base
source_root File.expand_path('../../templates', __FILE__)
def create_initializer_file
copy_file 'initializer.rb', 'config/initializers/rails_jwt_auth.rb'
end
def create_routes
route "resource :session, controller: 'rails_jwt_auth/sessions'... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/lib/generators/templates/initializer.rb | lib/generators/templates/initializer.rb | RailsJwtAuth.setup do |config|
# authentication model class name
# config.model_name = 'User'
# field name used to authentication with password
# config.auth_field_name = 'email'
# define email field name used to send emails
# config.email_field_name = 'email'
# Regex used to validate email input on re... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
rjurado01/rails_jwt_auth | https://github.com/rjurado01/rails_jwt_auth/blob/9726ea4cfe2c27c728a5a1926545cc98d82b025c/lib/generators/templates/migration.rb | lib/generators/templates/migration.rb | class Create<%= RailsJwtAuth.model_name.pluralize %> < ActiveRecord::Migration<%= migration_version %>
def change
create_table :<%= RailsJwtAuth.table_name %> do |t|
t.string :email
t.string :password_digest
t.string :auth_tokens
## Confirmable
# t.string :unconfirmed_email
# ... | ruby | MIT | 9726ea4cfe2c27c728a5a1926545cc98d82b025c | 2026-01-04T17:58:16.101421Z | false |
getsentry/examples | https://github.com/getsentry/examples/blob/02dbc89a35fe1804dbe00e481716a9dd79920cf5/ruby/sentry-sidekiq/error_worker.rb | ruby/sentry-sidekiq/error_worker.rb | # frozen_string_literal: true
require "sidekiq"
require "sentry-sidekiq"
Sentry.init do |config|
config.breadcrumbs_logger = [:sentry_logger]
# replace it with your sentry dsn
config.dsn = 'https://2fb45f003d054a7ea47feb45898f7649@o447951.ingest.sentry.io/5434472'
end
class ErrorWorker
include Sidekiq::Worke... | ruby | MIT | 02dbc89a35fe1804dbe00e481716a9dd79920cf5 | 2026-01-04T17:57:20.388692Z | false |
getsentry/examples | https://github.com/getsentry/examples/blob/02dbc89a35fe1804dbe00e481716a9dd79920cf5/ruby/sentry-ruby/without_integrations/app.rb | ruby/sentry-ruby/without_integrations/app.rb | require "sentry-ruby"
Sentry.init do |config|
config.dsn = 'https://2fb45f003d054a7ea47feb45898f7649@o447951.ingest.sentry.io/5434472'
end
Sentry.capture_message("test Sentry", hint: { background: false })
| ruby | MIT | 02dbc89a35fe1804dbe00e481716a9dd79920cf5 | 2026-01-04T17:57:20.388692Z | false |
getsentry/examples | https://github.com/getsentry/examples/blob/02dbc89a35fe1804dbe00e481716a9dd79920cf5/ruby/sentry-ruby/sinatra/app.rb | ruby/sentry-ruby/sinatra/app.rb | require 'sentry-ruby'
Sentry.init do |config|
config.dsn = 'https://2fb45f003d054a7ea47feb45898f7649@o447951.ingest.sentry.io/5434472'
config.traces_sample_rate = 1.0
# skips handled exceptions
config.before_send = lambda do |event, hint|
handled_errors = Sinatra::Application.errors.keys.grep(Class) # skip... | ruby | MIT | 02dbc89a35fe1804dbe00e481716a9dd79920cf5 | 2026-01-04T17:57:20.388692Z | false |
getsentry/examples | https://github.com/getsentry/examples/blob/02dbc89a35fe1804dbe00e481716a9dd79920cf5/ruby/sentry-ruby/crons/Rakefile.rb | ruby/sentry-ruby/crons/Rakefile.rb | require "sentry-ruby"
Sentry.init do |config|
config.dsn = 'https://2fb45f003d054a7ea47feb45898f7649@o447951.ingest.sentry.io/5434472'
end
# Create a config from an interval schedule (every 10 minutes)
monitor_config = Sentry::Cron::MonitorConfig.from_interval(
1,
:hour,
checkin_margin: 15, # Optional check-i... | ruby | MIT | 02dbc89a35fe1804dbe00e481716a9dd79920cf5 | 2026-01-04T17:57:20.388692Z | false |
getsentry/examples | https://github.com/getsentry/examples/blob/02dbc89a35fe1804dbe00e481716a9dd79920cf5/ruby/sentry-ruby/rake/Rakefile.rb | ruby/sentry-ruby/rake/Rakefile.rb | require "sentry-ruby"
Sentry.init do |config|
config.dsn = 'https://2fb45f003d054a7ea47feb45898f7649@o447951.ingest.sentry.io/5434472'
end
# bundle exec rake raise_exception
task :raise_exception do
1/0
end
# bundle exec rake send_message[foo]
task :send_message, ['name'] do |_task, args|
Sentry.capture_messa... | ruby | MIT | 02dbc89a35fe1804dbe00e481716a9dd79920cf5 | 2026-01-04T17:57:20.388692Z | false |
getsentry/examples | https://github.com/getsentry/examples/blob/02dbc89a35fe1804dbe00e481716a9dd79920cf5/ruby/sentry-resque/app.rb | ruby/sentry-resque/app.rb | # frozen_string_literal: true
require "active_job"
require "resque"
require "sentry-resque"
Sentry.init do |config|
config.breadcrumbs_logger = [:sentry_logger]
# replace it with your sentry dsn
config.dsn = 'https://2fb45f003d054a7ea47feb45898f7649@o447951.ingest.sentry.io/5434472'
end
class MyJob < ActiveJob... | ruby | MIT | 02dbc89a35fe1804dbe00e481716a9dd79920cf5 | 2026-01-04T17:57:20.388692Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.