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 |
|---|---|---|---|---|---|---|---|---|
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/orm/mongoid.rb | test/orm/mongoid.rb | # frozen_string_literal: true
require 'mongoid/version'
Mongoid.configure do |config|
config.load!('test/support/mongoid.yml')
config.use_utc = true
config.include_root_in_json = true
end
class ActiveSupport::TestCase
setup do
Mongoid::Config.purge!
end
end
| ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/mailers/email_changed_test.rb | test/mailers/email_changed_test.rb | # frozen_string_literal: true
require 'test_helper'
class EmailChangedTest < ActionMailer::TestCase
def setup
setup_mailer
Devise.mailer = 'Devise::Mailer'
Devise.mailer_sender = 'test@example.com'
Devise.send_email_changed_notification = true
end
def teardown
Devise.mailer = 'Devise::Maile... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/mailers/confirmation_instructions_test.rb | test/mailers/confirmation_instructions_test.rb | # frozen_string_literal: true
require 'test_helper'
class ConfirmationInstructionsTest < ActionMailer::TestCase
def setup
setup_mailer
Devise.mailer = 'Devise::Mailer'
Devise.mailer_sender = 'test@example.com'
end
def teardown
Devise.mailer = 'Devise::Mailer'
Devise.mailer_sender = 'please... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/mailers/mailer_test.rb | test/mailers/mailer_test.rb | # frozen_string_literal: true
require "test_helper"
class MailerTest < ActionMailer::TestCase
test "pass given block to #mail call" do
class TestMailer < Devise::Mailer
def confirmation_instructions(record, token, opts = {})
@token = token
devise_mail(record, :confirmation_instructions, op... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/mailers/reset_password_instructions_test.rb | test/mailers/reset_password_instructions_test.rb | # frozen_string_literal: true
require 'test_helper'
class ResetPasswordInstructionsTest < ActionMailer::TestCase
def setup
setup_mailer
Devise.mailer = 'Devise::Mailer'
Devise.mailer_sender = 'test@example.com'
end
def teardown
Devise.mailer = 'Devise::Mailer'
Devise.mailer_sender = 'please... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/mailers/unlock_instructions_test.rb | test/mailers/unlock_instructions_test.rb | # frozen_string_literal: true
require 'test_helper'
class UnlockInstructionsTest < ActionMailer::TestCase
def setup
setup_mailer
Devise.mailer = 'Devise::Mailer'
Devise.mailer_sender = 'test@example.com'
end
def teardown
Devise.mailer = 'Devise::Mailer'
Devise.mailer_sender = 'please-chang... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/app/helpers/application_helper.rb | test/rails_app/app/helpers/application_helper.rb | # frozen_string_literal: true
# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
end
| ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/app/mongoid/user_without_email.rb | test/rails_app/app/mongoid/user_without_email.rb | # frozen_string_literal: true
require "shared_user_without_email"
class UserWithoutEmail
include Mongoid::Document
include Shim
include SharedUserWithoutEmail
field :username, type: String
field :facebook_token, type: String
## Database authenticatable
field :email, type: String, default: ""
field :... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/app/mongoid/user_on_main_app.rb | test/rails_app/app/mongoid/user_on_main_app.rb | # frozen_string_literal: true
require 'shared_user_without_omniauth'
class UserOnMainApp
include Mongoid::Document
include Shim
include SharedUserWithoutOmniauth
field :username, type: String
field :facebook_token, type: String
## Database authenticatable
field :email, type: String, default: ""
fiel... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/app/mongoid/shim.rb | test/rails_app/app/mongoid/shim.rb | # frozen_string_literal: true
module Shim
extend ::ActiveSupport::Concern
included do
include ::Mongoid::Timestamps
field :created_at, type: DateTime
end
module ClassMethods
def order(attribute)
asc(attribute)
end
def find_by_email(email)
find_by(email: email)
end
end
... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/app/mongoid/user_on_engine.rb | test/rails_app/app/mongoid/user_on_engine.rb | # frozen_string_literal: true
require 'shared_user_without_omniauth'
class UserOnEngine
include Mongoid::Document
include Shim
include SharedUserWithoutOmniauth
field :username, type: String
field :facebook_token, type: String
## Database authenticatable
field :email, type: String, default: ""
field... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/app/mongoid/admin.rb | test/rails_app/app/mongoid/admin.rb | # frozen_string_literal: true
require 'shared_admin'
class Admin
include Mongoid::Document
include Shim
include SharedAdmin
## Database authenticatable
field :email, type: String
field :encrypted_password, type: String
## Recoverable
field :reset_password_token, type: String
field :... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/app/mongoid/user_with_validations.rb | test/rails_app/app/mongoid/user_with_validations.rb | # frozen_string_literal: true
require "shared_user"
class UserWithValidations
include Mongoid::Document
include Shim
include SharedUser
field :username, type: String
field :facebook_token, type: String
## Database authenticatable
field :email, type: String, default: ""
field :encrypted_password, typ... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/app/mongoid/user.rb | test/rails_app/app/mongoid/user.rb | # frozen_string_literal: true
require 'shared_user'
class User
include Mongoid::Document
include Shim
include SharedUser
field :username, type: String
field :facebook_token, type: String
## Database authenticatable
field :email, type: String, default: ""
field :encrypted_password, type:... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/app/controllers/admins_controller.rb | test/rails_app/app/controllers/admins_controller.rb | # frozen_string_literal: true
class AdminsController < ApplicationController
before_action :authenticate_admin!
def index
end
end
| ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/app/controllers/home_controller.rb | test/rails_app/app/controllers/home_controller.rb | # frozen_string_literal: true
class HomeController < ApplicationController
def index
end
def private
end
def user_dashboard
end
def admin_dashboard
end
def join
end
def set
session["devise.foo_bar"] = "something"
head :ok
end
def unauthenticated
render body: "unauthenticated... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/app/controllers/users_controller.rb | test/rails_app/app/controllers/users_controller.rb | # frozen_string_literal: true
class UsersController < ApplicationController
prepend_before_action :current_user, only: :exhibit
before_action :authenticate_user!, except: [:accept, :exhibit]
clear_respond_to
respond_to :html, :json
def index
user_session[:cart] = "Cart"
respond_with(current_user)
... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/app/controllers/streaming_controller.rb | test/rails_app/app/controllers/streaming_controller.rb | # frozen_string_literal: true
class StreamingController < ApplicationController
include ActionController::Live
before_action :authenticate_user!
def index
render body: 'Index'
end
end
| ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/app/controllers/application_with_fake_engine.rb | test/rails_app/app/controllers/application_with_fake_engine.rb | # frozen_string_literal: true
class ApplicationWithFakeEngine < ApplicationController
private
helper_method :fake_engine
def fake_engine
@fake_engine ||= FakeEngine.new
end
end
class FakeEngine
def user_on_engine_confirmation_path
'/user_on_engine/confirmation'
end
def new_user_on_engine_sessi... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/app/controllers/application_controller.rb | test/rails_app/app/controllers/application_controller.rb | # frozen_string_literal: true
# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.
class ApplicationController < ActionController::Base
protect_from_forgery
around_action :set_locale
before_action :current_user, ... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/app/controllers/custom/registrations_controller.rb | test/rails_app/app/controllers/custom/registrations_controller.rb | # frozen_string_literal: true
class Custom::RegistrationsController < Devise::RegistrationsController
def new
super do |resource|
@new_block_called = true
end
end
def create
super do |resource|
@create_block_called = true
end
end
def update
super do |resource|
@update_... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/app/controllers/publisher/registrations_controller.rb | test/rails_app/app/controllers/publisher/registrations_controller.rb | # frozen_string_literal: true
class Publisher::RegistrationsController < ApplicationController
end
| ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/app/controllers/publisher/sessions_controller.rb | test/rails_app/app/controllers/publisher/sessions_controller.rb | # frozen_string_literal: true
class Publisher::SessionsController < ApplicationController
end
| ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/app/controllers/admins/sessions_controller.rb | test/rails_app/app/controllers/admins/sessions_controller.rb | # frozen_string_literal: true
class Admins::SessionsController < Devise::SessionsController
def new
flash[:special] = "Welcome to #{controller_path.inspect} controller!"
super
end
end
| ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/app/controllers/users/omniauth_callbacks_controller.rb | test/rails_app/app/controllers/users/omniauth_callbacks_controller.rb | # frozen_string_literal: true
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
def facebook
data = request.respond_to?(:get_header) ? request.get_header("omniauth.auth") : request.env["omniauth.auth"]
session["devise.facebook_data"] = data["extra"]["user_hash"]
render json: ... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/app/active_record/user_without_email.rb | test/rails_app/app/active_record/user_without_email.rb | # frozen_string_literal: true
require "shared_user_without_email"
class UserWithoutEmail < ActiveRecord::Base
self.table_name = 'users'
include Shim
include SharedUserWithoutEmail
end
| ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/app/active_record/user_on_main_app.rb | test/rails_app/app/active_record/user_on_main_app.rb | # frozen_string_literal: true
require 'shared_user_without_omniauth'
class UserOnMainApp < ActiveRecord::Base
self.table_name = 'users'
include Shim
include SharedUserWithoutOmniauth
end
| ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/app/active_record/shim.rb | test/rails_app/app/active_record/shim.rb | # frozen_string_literal: true
module Shim
end
| ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/app/active_record/user_on_engine.rb | test/rails_app/app/active_record/user_on_engine.rb | # frozen_string_literal: true
require 'shared_user_without_omniauth'
class UserOnEngine < ActiveRecord::Base
self.table_name = 'users'
include Shim
include SharedUserWithoutOmniauth
end
| ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/app/active_record/admin.rb | test/rails_app/app/active_record/admin.rb | # frozen_string_literal: true
require 'shared_admin'
class Admin < ActiveRecord::Base
include Shim
include SharedAdmin
end
| ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/app/active_record/user_with_validations.rb | test/rails_app/app/active_record/user_with_validations.rb | # frozen_string_literal: true
require 'shared_user'
class UserWithValidations < ActiveRecord::Base
self.table_name = 'users'
include Shim
include SharedUser
validates :email, presence: true
end
| ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/app/active_record/user.rb | test/rails_app/app/active_record/user.rb | # frozen_string_literal: true
require 'shared_user'
class User < ActiveRecord::Base
include Shim
include SharedUser
validates :sign_in_count, presence: true
cattr_accessor :validations_performed
after_validation :after_validation_callback
def after_validation_callback
# used to check in our test i... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/app/mailers/users/mailer.rb | test/rails_app/app/mailers/users/mailer.rb | # frozen_string_literal: true
class Users::Mailer < Devise::Mailer
default from: 'custom@example.com'
end
| ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/app/mailers/users/reply_to_mailer.rb | test/rails_app/app/mailers/users/reply_to_mailer.rb | # frozen_string_literal: true
class Users::ReplyToMailer < Devise::Mailer
default from: 'custom@example.com'
default reply_to: 'custom_reply_to@example.com'
end
| ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/app/mailers/users/from_proc_mailer.rb | test/rails_app/app/mailers/users/from_proc_mailer.rb | # frozen_string_literal: true
class Users::FromProcMailer < Devise::Mailer
default from: proc { 'custom@example.com' }
end
| ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/db/schema.rb | test/rails_app/db/schema.rb | # encoding: UTF-8
# frozen_string_literal: true
# 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 defi... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/db/migrate/20100401102949_create_tables.rb | test/rails_app/db/migrate/20100401102949_create_tables.rb | # frozen_string_literal: true
class CreateTables < ActiveRecord::Migration[5.0]
def self.up
create_table :users do |t|
t.string :username
t.string :facebook_token
## Database authenticatable
t.string :email, null: false, default: ""
t.string :encrypted_password, null: ... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/lib/shared_user_without_omniauth.rb | test/rails_app/lib/shared_user_without_omniauth.rb | # frozen_string_literal: true
module SharedUserWithoutOmniauth
extend ActiveSupport::Concern
included do
devise :database_authenticatable, :confirmable, :lockable, :recoverable,
:registerable, :rememberable, :timeoutable,
:trackable, :validatable, reconfirmable: false
end
def raw_confirmation... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/lib/shared_admin.rb | test/rails_app/lib/shared_admin.rb | # frozen_string_literal: true
module SharedAdmin
extend ActiveSupport::Concern
included do
devise :database_authenticatable, :registerable,
:timeoutable, :recoverable, :lockable, :confirmable,
unlock_strategy: :time, lock_strategy: :none,
allow_unconfirmed_access_for: 2.weeks,... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/lib/shared_user.rb | test/rails_app/lib/shared_user.rb | # frozen_string_literal: true
module SharedUser
extend ActiveSupport::Concern
included do
devise :database_authenticatable, :confirmable, :lockable, :recoverable,
:registerable, :rememberable, :timeoutable,
:trackable, :validatable, :omniauthable, password_length: 7..72,
recon... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/lib/shared_user_without_email.rb | test/rails_app/lib/shared_user_without_email.rb | # frozen_string_literal: true
module SharedUserWithoutEmail
extend ActiveSupport::Concern
included do
# NOTE: This is missing :validatable and :confirmable, as they both require
# an email field at the moment. It is also missing :omniauthable because that
# adds unnecessary complexity to the setup
... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/lib/lazy_load_test_module.rb | test/rails_app/lib/lazy_load_test_module.rb | module LazyLoadTestModule
def lazy_loading_works?
"yes it does"
end
end | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/config/application.rb | test/rails_app/config/application.rb | # frozen_string_literal: true
require File.expand_path('../boot', __FILE__)
require "logger"
require "action_controller/railtie"
require "action_mailer/railtie"
require "rails/test_unit/railtie"
Bundler.require :default, DEVISE_ORM
begin
require "#{DEVISE_ORM}/railtie"
rescue LoadError
end
require "devise"
modu... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/config/environment.rb | test/rails_app/config/environment.rb | # frozen_string_literal: true
# Load the rails application.
require File.expand_path('../application', __FILE__)
# Initialize the rails application.
RailsApp::Application.initialize!
| ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/config/routes.rb | test/rails_app/config/routes.rb | # frozen_string_literal: true
Rails.application.routes.draw do
# Resources for testing
resources :users, only: [:index] do
member do
get :expire
get :accept
get :edit_form
put :update_form
end
authenticate do
post :exhibit, on: :member
end
end
resources :admins, ... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/config/boot.rb | test/rails_app/config/boot.rb | # frozen_string_literal: true
unless defined?(DEVISE_ORM)
DEVISE_ORM = (ENV["DEVISE_ORM"] || :active_record).to_sym
end
module Devise
module Test
# Detection for minor differences between Rails versions in tests.
def self.rails71_and_up?
!rails70? && Rails::VERSION::MAJOR >= 7
end
def self... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/config/initializers/session_store.rb | test/rails_app/config/initializers/session_store.rb | # frozen_string_literal: true
RailsApp::Application.config.session_store :cookie_store, key: '_rails_app_session'
| ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/config/initializers/devise.rb | test/rails_app/config/initializers/devise.rb | # frozen_string_literal: true
require "omniauth-facebook"
require "omniauth-openid"
# Assuming you have not yet modified this file, each configuration option below
# is set to its default value. Note that some are commented out while others
# are not: uncommented lines are intended to protect your configuration from
... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/config/initializers/inflections.rb | test/rails_app/config/initializers/inflections.rb | # frozen_string_literal: true
ActiveSupport::Inflector.inflections do |inflect|
end
| ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/config/initializers/backtrace_silencers.rb | test/rails_app/config/initializers/backtrace_silencers.rb | # frozen_string_literal: true
# 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... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/config/initializers/secret_token.rb | test/rails_app/config/initializers/secret_token.rb | # frozen_string_literal: true
config = Rails.application.config
config.secret_key_base = 'd588e99efff13a86461fd6ab82327823ad2f8feb5dc217ce652cdd9f0dfc5eb4b5a62a92d24d2574d7d51dfb1ea8dd453ea54e00cf672159a13104a135422a10'
| ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/config/environments/test.rb | test/rails_app/config/environments/test.rb | # frozen_string_literal: true
RailsApp::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 i... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/config/environments/development.rb | test/rails_app/config/environments/development.rb | # frozen_string_literal: true
RailsApp::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... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_app/config/environments/production.rb | test/rails_app/config/environments/production.rb | # frozen_string_literal: true
RailsApp::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 memor... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/devise.rb | lib/devise.rb | # frozen_string_literal: true
require 'rails'
require 'active_support/core_ext/numeric/time'
require 'active_support/dependencies'
require 'orm_adapter'
require 'set'
require 'securerandom'
require 'responders'
module Devise
autoload :Delegator, 'devise/delegator'
autoload :Encryptor, 'devise/en... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/generators/mongoid/devise_generator.rb | lib/generators/mongoid/devise_generator.rb | # frozen_string_literal: true
require 'rails/generators/named_base'
require 'generators/devise/orm_helpers'
module Mongoid
module Generators
class DeviseGenerator < Rails::Generators::NamedBase
include Devise::Generators::OrmHelpers
def generate_model
invoke "mongoid:model", [name] unless m... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/generators/devise/orm_helpers.rb | lib/generators/devise/orm_helpers.rb | # frozen_string_literal: true
module Devise
module Generators
module OrmHelpers
def model_contents
buffer = <<-CONTENT
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
devise :database_authenticatable, :registerable,... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/generators/devise/controllers_generator.rb | lib/generators/devise/controllers_generator.rb | # frozen_string_literal: true
require 'rails/generators/base'
module Devise
module Generators
class ControllersGenerator < Rails::Generators::Base
CONTROLLERS = %w(confirmations passwords registrations sessions unlocks omniauth_callbacks).freeze
desc <<-DESC.strip_heredoc
Create inherited D... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/generators/devise/views_generator.rb | lib/generators/devise/views_generator.rb | # frozen_string_literal: true
require 'rails/generators/base'
module Devise
module Generators
# Include this module in your generator to generate Devise views.
# `copy_views` is the main method and by default copies all views
# with forms.
module ViewPathTemplates #:nodoc:
extend ActiveSupport... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/generators/devise/devise_generator.rb | lib/generators/devise/devise_generator.rb | # frozen_string_literal: true
require 'rails/generators/named_base'
module Devise
module Generators
class DeviseGenerator < Rails::Generators::NamedBase
include Rails::Generators::ResourceHelpers
namespace "devise"
source_root File.expand_path("../templates", __FILE__)
desc "Generates ... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/generators/devise/install_generator.rb | lib/generators/devise/install_generator.rb | # frozen_string_literal: true
require 'rails/generators/base'
require 'securerandom'
module Devise
module Generators
MissingORMError = Class.new(Thor::Error)
class InstallGenerator < Rails::Generators::Base
source_root File.expand_path("../../templates", __FILE__)
desc "Creates a Devise initia... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/generators/templates/devise.rb | lib/generators/templates/devise.rb | # frozen_string_literal: true
# Assuming you have not yet modified this file, each configuration option below
# is set to its default value. Note that some are commented out while others
# are not: uncommented lines are intended to protect your configuration from
# breaking changes in upgrades (i.e., in the event that... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/generators/templates/controllers/omniauth_callbacks_controller.rb | lib/generators/templates/controllers/omniauth_callbacks_controller.rb | # frozen_string_literal: true
class <%= @scope_prefix %>OmniauthCallbacksController < Devise::OmniauthCallbacksController
# You should configure your model like this:
# devise :omniauthable, omniauth_providers: [:twitter]
# You should also create an action method in this controller like this:
# def twitter
... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/generators/templates/controllers/passwords_controller.rb | lib/generators/templates/controllers/passwords_controller.rb | # frozen_string_literal: true
class <%= @scope_prefix %>PasswordsController < Devise::PasswordsController
# GET /resource/password/new
# def new
# super
# end
# POST /resource/password
# def create
# super
# end
# GET /resource/password/edit?reset_password_token=abcdef
# def edit
# super
... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/generators/templates/controllers/unlocks_controller.rb | lib/generators/templates/controllers/unlocks_controller.rb | # frozen_string_literal: true
class <%= @scope_prefix %>UnlocksController < Devise::UnlocksController
# GET /resource/unlock/new
# def new
# super
# end
# POST /resource/unlock
# def create
# super
# end
# GET /resource/unlock?unlock_token=abcdef
# def show
# super
# end
# protected
... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/generators/templates/controllers/registrations_controller.rb | lib/generators/templates/controllers/registrations_controller.rb | # frozen_string_literal: true
class <%= @scope_prefix %>RegistrationsController < Devise::RegistrationsController
# before_action :configure_sign_up_params, only: [:create]
# before_action :configure_account_update_params, only: [:update]
# GET /resource/sign_up
# def new
# super
# end
# POST /resour... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/generators/templates/controllers/confirmations_controller.rb | lib/generators/templates/controllers/confirmations_controller.rb | # frozen_string_literal: true
class <%= @scope_prefix %>ConfirmationsController < Devise::ConfirmationsController
# GET /resource/confirmation/new
# def new
# super
# end
# POST /resource/confirmation
# def create
# super
# end
# GET /resource/confirmation?confirmation_token=abcdef
# def show... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/generators/templates/controllers/sessions_controller.rb | lib/generators/templates/controllers/sessions_controller.rb | # frozen_string_literal: true
class <%= @scope_prefix %>SessionsController < Devise::SessionsController
# before_action :configure_sign_in_params, only: [:create]
# GET /resource/sign_in
# def new
# super
# end
# POST /resource/sign_in
# def create
# super
# end
# DELETE /resource/sign_out
... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/generators/active_record/devise_generator.rb | lib/generators/active_record/devise_generator.rb | # frozen_string_literal: true
require 'rails/generators/active_record'
require 'generators/devise/orm_helpers'
module ActiveRecord
module Generators
class DeviseGenerator < Base
argument :attributes, type: :array, default: [], banner: "field:type field:type"
class_option :primary_key_type, type: :s... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/generators/active_record/templates/migration_existing.rb | lib/generators/active_record/templates/migration_existing.rb | # frozen_string_literal: true
class AddDeviseTo<%= table_name.camelize %> < ActiveRecord::Migration<%= migration_version %>
def self.up
change_table :<%= table_name %> do |t|
<%= migration_data -%>
<% attributes.each do |attribute| -%>
t.<%= attribute.type %> :<%= attribute.name %>
<% end -%>
# Unc... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/generators/active_record/templates/migration.rb | lib/generators/active_record/templates/migration.rb | # frozen_string_literal: true
class DeviseCreate<%= table_name.camelize %> < ActiveRecord::Migration<%= migration_version %>
def change
create_table :<%= table_name %><%= primary_key_type %> do |t|
<%= migration_data -%>
<% attributes.each do |attribute| -%>
t.<%= attribute.type %> :<%= attribute.name %>
... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/devise/version.rb | lib/devise/version.rb | # frozen_string_literal: true
module Devise
VERSION = "5.0.0.rc".freeze
end
| ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/devise/rails.rb | lib/devise/rails.rb | # frozen_string_literal: true
require 'devise/rails/routes'
require 'devise/rails/warden_compat'
module Devise
class Engine < ::Rails::Engine
config.devise = Devise
# Initialize Warden and copy its configurations.
config.app_middleware.use Warden::Manager do |config|
Devise.warden_config = config... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/devise/orm.rb | lib/devise/orm.rb | # frozen_string_literal: true
module Devise
module Orm # :nodoc:
def self.active_record?(model)
defined?(ActiveRecord) && model < ActiveRecord::Base
end
def self.included(model)
if Devise::Orm.active_record?(model)
model.include DirtyTrackingActiveRecordMethods
else
mod... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/devise/delegator.rb | lib/devise/delegator.rb | # frozen_string_literal: true
module Devise
# Checks the scope in the given environment and returns the associated failure app.
class Delegator
def call(env)
failure_app(env).call(env)
end
def failure_app(env)
app = env["warden.options"] &&
(scope = env["warden.options"][:scope]) &... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/devise/mapping.rb | lib/devise/mapping.rb | # frozen_string_literal: true
module Devise
# Responsible for handling devise mappings and routes configuration. Each
# resource configured by devise_for in routes is actually creating a mapping
# object. You can refer to devise_for in routes for usage options.
#
# The required value in devise_for is actuall... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/devise/parameter_filter.rb | lib/devise/parameter_filter.rb | # frozen_string_literal: true
module Devise
class ParameterFilter
def initialize(case_insensitive_keys, strip_whitespace_keys)
@case_insensitive_keys = case_insensitive_keys || []
@strip_whitespace_keys = strip_whitespace_keys || []
end
def filter(conditions)
conditions = stringify_par... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/devise/failure_app.rb | lib/devise/failure_app.rb | # frozen_string_literal: true
require "action_controller/metal"
module Devise
# Failure application that will be called every time :warden is thrown from
# any strategy or hook. It is responsible for redirecting the user to the sign
# in page based on current scope and mapping. If no scope is given, it
# redi... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/devise/encryptor.rb | lib/devise/encryptor.rb | # frozen_string_literal: true
require 'bcrypt'
module Devise
module Encryptor
def self.digest(klass, password)
if klass.pepper.present?
password = "#{password}#{klass.pepper}"
end
::BCrypt::Password.create(password, cost: klass.stretches).to_s
end
def self.compare(klass, hashe... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/devise/models.rb | lib/devise/models.rb | # frozen_string_literal: true
module Devise
module Models
class MissingAttribute < StandardError
def initialize(attributes)
@attributes = attributes
end
def message
"The following attribute(s) is (are) missing on your model: #{@attributes.join(", ")}"
end
end
# C... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/devise/token_generator.rb | lib/devise/token_generator.rb | # frozen_string_literal: true
require 'openssl'
module Devise
class TokenGenerator
def initialize(key_generator, digest = "SHA256")
@key_generator = key_generator
@digest = digest
end
def digest(klass, column, value)
value.present? && OpenSSL::HMAC.hexdigest(@digest, key_for(column), ... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/devise/omniauth.rb | lib/devise/omniauth.rb | # frozen_string_literal: true
begin
gem "omniauth", ">= 1.0.0"
require "omniauth"
rescue LoadError
warn "Could not load 'omniauth'. Please ensure you have the omniauth gem >= 1.0.0 installed and listed in your Gemfile."
raise
end
# Clean up the default path_prefix. It will be automatically set by Devise.
Omn... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/devise/parameter_sanitizer.rb | lib/devise/parameter_sanitizer.rb | # frozen_string_literal: true
module Devise
# The +ParameterSanitizer+ deals with permitting specific parameters values
# for each +Devise+ scope in the application.
#
# The sanitizer knows about Devise default parameters (like +password+ and
# +password_confirmation+ for the `RegistrationsController`), and ... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/devise/time_inflector.rb | lib/devise/time_inflector.rb | # frozen_string_literal: true
require "active_support/core_ext/module/delegation"
module Devise
class TimeInflector
include ActionView::Helpers::DateHelper
class << self
attr_reader :instance
delegate :time_ago_in_words, to: :instance
end
@instance = new
end
end
| ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/devise/modules.rb | lib/devise/modules.rb | # frozen_string_literal: true
require 'active_support/core_ext/object/with_options'
Devise.with_options model: true do |d|
# Strategies first
d.with_options strategy: true do |s|
routes = [nil, :new, :destroy]
s.add_module :database_authenticatable, controller: :sessions, route: { session: routes }
s.... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/devise/rails/routes.rb | lib/devise/rails/routes.rb | # frozen_string_literal: true
require "active_support/core_ext/object/try"
require "active_support/core_ext/hash/slice"
module Devise
module RouteSet
def finalize!
result = super
@devise_finalized ||= begin
if Devise.router_name.nil? && defined?(@devise_finalized) && self != Rails.applicatio... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/devise/rails/warden_compat.rb | lib/devise/rails/warden_compat.rb | # frozen_string_literal: true
module Warden::Mixins::Common
def request
@request ||= ActionDispatch::Request.new(env)
end
def reset_session!
request.reset_session
end
def cookies
request.cookie_jar
end
end
| ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/devise/controllers/store_location.rb | lib/devise/controllers/store_location.rb | # frozen_string_literal: true
require "uri"
module Devise
module Controllers
# Provide the ability to store a location.
# Used to redirect back to a desired path after sign in.
# Included by default in all controllers.
module StoreLocation
# Returns and delete (if it's navigational format) the... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/devise/controllers/rememberable.rb | lib/devise/controllers/rememberable.rb | # frozen_string_literal: true
module Devise
module Controllers
# A module that may be optionally included in a controller in order
# to provide remember me behavior. Useful when signing in is done
# through a callback, like in OmniAuth.
module Rememberable
# Return default cookie values retriev... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/devise/controllers/responder.rb | lib/devise/controllers/responder.rb | # frozen_string_literal: true
module Devise
module Controllers
# Custom Responder to configure default statuses that only apply to Devise,
# and allow to integrate more easily with Hotwire/Turbo.
class Responder < ActionController::Responder
if respond_to?(:error_status=) && respond_to?(:redirect_s... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/devise/controllers/sign_in_out.rb | lib/devise/controllers/sign_in_out.rb | # frozen_string_literal: true
module Devise
module Controllers
# Provide sign in and sign out functionality.
# Included by default in all controllers.
module SignInOut
# Return true if the given scope is signed in session. If no scope given, return
# true if any scope is signed in. This will ... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/devise/controllers/scoped_views.rb | lib/devise/controllers/scoped_views.rb | # frozen_string_literal: true
module Devise
module Controllers
module ScopedViews
extend ActiveSupport::Concern
module ClassMethods
def scoped_views?
defined?(@scoped_views) ? @scoped_views : Devise.scoped_views
end
def scoped_views=(value)
@scoped_views ... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/devise/controllers/helpers.rb | lib/devise/controllers/helpers.rb | # frozen_string_literal: true
module Devise
module Controllers
# Those helpers are convenience methods added to ApplicationController.
module Helpers
extend ActiveSupport::Concern
include Devise::Controllers::SignInOut
include Devise::Controllers::StoreLocation
included do
if... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/devise/controllers/url_helpers.rb | lib/devise/controllers/url_helpers.rb | # frozen_string_literal: true
module Devise
module Controllers
# Create url helpers to be used with resource/scope configuration. Acts as
# proxies to the generated routes created by devise.
# Resource param can be a string or symbol, a class, or an instance object.
# Example using a :user resource:
... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/devise/hooks/csrf_cleaner.rb | lib/devise/hooks/csrf_cleaner.rb | # frozen_string_literal: true
Warden::Manager.after_authentication do |record, warden, options|
clean_up_for_winning_strategy = !warden.winning_strategy.respond_to?(:clean_up_csrf?) ||
warden.winning_strategy.clean_up_csrf?
if Devise.clean_up_csrf_token_on_authentication && clean_up_for_winning_strategy
if... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/devise/hooks/lockable.rb | lib/devise/hooks/lockable.rb | # frozen_string_literal: true
# After each sign in, if resource responds to failed_attempts, sets it to 0
# This is only triggered when the user is explicitly set (with set_user)
Warden::Manager.after_set_user except: :fetch do |record, warden, options|
if record.respond_to?(:reset_failed_attempts!) && warden.authen... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/devise/hooks/rememberable.rb | lib/devise/hooks/rememberable.rb | # frozen_string_literal: true
Warden::Manager.after_set_user except: :fetch do |record, warden, options|
scope = options[:scope]
if record.respond_to?(:remember_me) && options[:store] != false &&
record.remember_me && warden.authenticated?(scope)
Devise::Hooks::Proxy.new(warden).remember_me(record)
end
... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/devise/hooks/activatable.rb | lib/devise/hooks/activatable.rb | # frozen_string_literal: true
# Deny user access whenever their account is not active yet.
# We need this as hook to validate the user activity on each request
# and in case the user is using other strategies beside Devise ones.
Warden::Manager.after_set_user do |record, warden, options|
if record && record.respond_... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/devise/hooks/proxy.rb | lib/devise/hooks/proxy.rb | # frozen_string_literal: true
module Devise
module Hooks
# A small warden proxy so we can remember, forget and
# sign out users from hooks.
class Proxy #:nodoc:
include Devise::Controllers::Rememberable
include Devise::Controllers::SignInOut
attr_reader :warden
delegate :cookies,... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
heartcombo/devise | https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/lib/devise/hooks/timeoutable.rb | lib/devise/hooks/timeoutable.rb | # frozen_string_literal: true
# Each time a record is set we check whether its session has already timed out
# or not, based on last request time. If so, the record is logged out and
# redirected to the sign in page. Also, each time the request comes and the
# record is set, we set the last request time inside its sco... | ruby | MIT | 00a97782cb91104a72ea68d8f62ca8aa0e6eb101 | 2026-01-04T15:37:27.393664Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.