devise 2.1.2 → 3.5.10
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of devise might be problematic. Click here for more details.
- checksums.yaml +7 -0
- data/.travis.yml +39 -10
- data/.yardopts +9 -0
- data/{CHANGELOG.rdoc → CHANGELOG.md} +445 -112
- data/CODE_OF_CONDUCT.md +22 -0
- data/CONTRIBUTING.md +16 -0
- data/Gemfile +10 -15
- data/Gemfile.lock +151 -129
- data/MIT-LICENSE +1 -1
- data/README.md +256 -96
- data/Rakefile +4 -2
- data/app/controllers/devise/confirmations_controller.rb +15 -7
- data/app/controllers/devise/omniauth_callbacks_controller.rb +6 -2
- data/app/controllers/devise/passwords_controller.rb +33 -9
- data/app/controllers/devise/registrations_controller.rb +66 -26
- data/app/controllers/devise/sessions_controller.rb +52 -21
- data/app/controllers/devise/unlocks_controller.rb +11 -6
- data/app/controllers/devise_controller.rb +65 -58
- data/app/helpers/devise_helper.rb +2 -2
- data/app/mailers/devise/mailer.rb +19 -10
- data/app/views/devise/confirmations/new.html.erb +8 -4
- data/app/views/devise/mailer/confirmation_instructions.html.erb +2 -2
- data/app/views/devise/mailer/password_change.html.erb +3 -0
- data/app/views/devise/mailer/reset_password_instructions.html.erb +2 -2
- data/app/views/devise/mailer/unlock_instructions.html.erb +2 -2
- data/app/views/devise/passwords/edit.html.erb +15 -6
- data/app/views/devise/passwords/new.html.erb +8 -4
- data/app/views/devise/registrations/edit.html.erb +29 -15
- data/app/views/devise/registrations/new.html.erb +19 -8
- data/app/views/devise/sessions/new.html.erb +17 -8
- data/app/views/devise/shared/{_links.erb → _links.html.erb} +4 -4
- data/app/views/devise/unlocks/new.html.erb +8 -4
- data/config/locales/en.yml +51 -47
- data/devise.gemspec +8 -6
- data/devise.png +0 -0
- data/gemfiles/Gemfile.rails-3.2-stable +29 -0
- data/gemfiles/Gemfile.rails-3.2-stable.lock +172 -0
- data/gemfiles/Gemfile.rails-4.0-stable +30 -0
- data/gemfiles/Gemfile.rails-4.0-stable.lock +166 -0
- data/gemfiles/Gemfile.rails-4.1-stable +30 -0
- data/gemfiles/Gemfile.rails-4.1-stable.lock +171 -0
- data/gemfiles/Gemfile.rails-4.2-stable +30 -0
- data/gemfiles/Gemfile.rails-4.2-stable.lock +193 -0
- data/lib/devise/controllers/helpers.rb +126 -108
- data/lib/devise/controllers/rememberable.rb +19 -17
- data/lib/devise/controllers/scoped_views.rb +1 -1
- data/lib/devise/controllers/sign_in_out.rb +96 -0
- data/lib/devise/controllers/store_location.rb +58 -0
- data/lib/devise/controllers/url_helpers.rb +7 -7
- data/lib/devise/encryptor.rb +22 -0
- data/lib/devise/failure_app.rb +85 -25
- data/lib/devise/hooks/activatable.rb +5 -6
- data/lib/devise/hooks/csrf_cleaner.rb +7 -0
- data/lib/devise/hooks/forgetable.rb +1 -1
- data/lib/devise/hooks/lockable.rb +2 -2
- data/lib/devise/hooks/proxy.rb +21 -0
- data/lib/devise/hooks/rememberable.rb +5 -4
- data/lib/devise/hooks/timeoutable.rb +16 -8
- data/lib/devise/hooks/trackable.rb +1 -1
- data/lib/devise/mailers/helpers.rb +27 -23
- data/lib/devise/mapping.rb +11 -7
- data/lib/devise/models/authenticatable.rb +82 -66
- data/lib/devise/models/confirmable.rb +142 -55
- data/lib/devise/models/database_authenticatable.rb +59 -15
- data/lib/devise/models/lockable.rb +41 -30
- data/lib/devise/models/omniauthable.rb +3 -3
- data/lib/devise/models/recoverable.rb +56 -41
- data/lib/devise/models/rememberable.rb +65 -27
- data/lib/devise/models/timeoutable.rb +2 -8
- data/lib/devise/models/trackable.rb +6 -4
- data/lib/devise/models/validatable.rb +9 -9
- data/lib/devise/models.rb +4 -13
- data/lib/devise/modules.rb +10 -11
- data/lib/devise/omniauth/url_helpers.rb +2 -2
- data/lib/devise/orm/active_record.rb +1 -1
- data/lib/devise/orm/mongoid.rb +1 -1
- data/lib/devise/{param_filter.rb → parameter_filter.rb} +10 -11
- data/lib/devise/parameter_sanitizer.rb +99 -0
- data/lib/devise/rails/routes.rb +173 -115
- data/lib/devise/rails/warden_compat.rb +10 -31
- data/lib/devise/rails.rb +14 -12
- data/lib/devise/strategies/authenticatable.rb +26 -26
- data/lib/devise/strategies/base.rb +1 -1
- data/lib/devise/strategies/database_authenticatable.rb +8 -4
- data/lib/devise/strategies/rememberable.rb +15 -5
- data/lib/devise/test_helpers.rb +7 -5
- data/lib/devise/time_inflector.rb +14 -0
- data/lib/devise/token_generator.rb +70 -0
- data/lib/devise/version.rb +1 -1
- data/lib/devise.rb +110 -52
- data/lib/generators/active_record/devise_generator.rb +34 -18
- data/lib/generators/active_record/templates/migration.rb +5 -6
- data/lib/generators/active_record/templates/migration_existing.rb +5 -6
- data/lib/generators/devise/controllers_generator.rb +44 -0
- data/lib/generators/devise/devise_generator.rb +5 -3
- data/lib/generators/devise/install_generator.rb +5 -0
- data/lib/generators/devise/orm_helpers.rb +25 -6
- data/lib/generators/devise/views_generator.rb +52 -22
- data/lib/generators/mongoid/devise_generator.rb +21 -26
- data/lib/generators/templates/README +9 -5
- data/lib/generators/templates/controllers/README +14 -0
- data/lib/generators/templates/controllers/confirmations_controller.rb +28 -0
- data/lib/generators/templates/controllers/omniauth_callbacks_controller.rb +28 -0
- data/lib/generators/templates/controllers/passwords_controller.rb +32 -0
- data/lib/generators/templates/controllers/registrations_controller.rb +60 -0
- data/lib/generators/templates/controllers/sessions_controller.rb +25 -0
- data/lib/generators/templates/controllers/unlocks_controller.rb +28 -0
- data/lib/generators/templates/devise.rb +80 -43
- data/lib/generators/templates/markerb/confirmation_instructions.markerb +2 -2
- data/lib/generators/templates/markerb/password_change.markerb +3 -0
- data/lib/generators/templates/markerb/reset_password_instructions.markerb +1 -1
- data/lib/generators/templates/markerb/unlock_instructions.markerb +2 -2
- data/lib/generators/templates/simple_form_for/confirmations/new.html.erb +3 -2
- data/lib/generators/templates/simple_form_for/passwords/edit.html.erb +4 -4
- data/lib/generators/templates/simple_form_for/passwords/new.html.erb +2 -2
- data/lib/generators/templates/simple_form_for/registrations/edit.html.erb +11 -6
- data/lib/generators/templates/simple_form_for/registrations/new.html.erb +4 -4
- data/lib/generators/templates/simple_form_for/sessions/new.html.erb +6 -6
- data/lib/generators/templates/simple_form_for/unlocks/new.html.erb +3 -2
- data/script/cached-bundle +49 -0
- data/script/s3-put +71 -0
- data/test/controllers/custom_registrations_controller_test.rb +40 -0
- data/test/controllers/helper_methods_test.rb +21 -0
- data/test/controllers/helpers_test.rb +95 -32
- data/test/controllers/inherited_controller_i18n_messages_test.rb +51 -0
- data/test/controllers/internal_helpers_test.rb +39 -14
- data/test/controllers/load_hooks_controller_test.rb +19 -0
- data/test/controllers/passwords_controller_test.rb +31 -0
- data/test/controllers/sessions_controller_test.rb +66 -6
- data/test/controllers/url_helpers_test.rb +10 -4
- data/test/delegator_test.rb +1 -1
- data/test/devise_test.rb +45 -10
- data/test/failure_app_test.rb +121 -27
- data/test/generators/active_record_generator_test.rb +48 -8
- data/test/generators/controllers_generator_test.rb +48 -0
- data/test/generators/devise_generator_test.rb +2 -2
- data/test/generators/mongoid_generator_test.rb +3 -3
- data/test/generators/views_generator_test.rb +54 -3
- data/test/helpers/devise_helper_test.rb +18 -20
- data/test/integration/authenticatable_test.rb +161 -65
- data/test/integration/confirmable_test.rb +146 -77
- data/test/integration/database_authenticatable_test.rb +43 -30
- data/test/integration/http_authenticatable_test.rb +30 -22
- data/test/integration/lockable_test.rb +64 -49
- data/test/integration/omniauthable_test.rb +17 -15
- data/test/integration/recoverable_test.rb +111 -70
- data/test/integration/registerable_test.rb +114 -79
- data/test/integration/rememberable_test.rb +87 -31
- data/test/integration/timeoutable_test.rb +77 -33
- data/test/integration/trackable_test.rb +5 -5
- data/test/mailers/confirmation_instructions_test.rb +28 -8
- data/test/mailers/reset_password_instructions_test.rb +21 -8
- data/test/mailers/unlock_instructions_test.rb +20 -6
- data/test/mapping_test.rb +12 -5
- data/test/models/authenticatable_test.rb +17 -1
- data/test/models/confirmable_test.rb +216 -62
- data/test/models/database_authenticatable_test.rb +129 -49
- data/test/models/lockable_test.rb +132 -45
- data/test/models/recoverable_test.rb +100 -54
- data/test/models/rememberable_test.rb +89 -94
- data/test/models/serializable_test.rb +12 -11
- data/test/models/timeoutable_test.rb +6 -1
- data/test/models/trackable_test.rb +28 -0
- data/test/models/validatable_test.rb +31 -21
- data/test/models_test.rb +22 -48
- data/test/omniauth/config_test.rb +4 -4
- data/test/omniauth/url_helpers_test.rb +7 -4
- data/test/orm/active_record.rb +1 -0
- data/test/orm/mongoid.rb +2 -3
- data/test/parameter_sanitizer_test.rb +81 -0
- data/test/rails_app/Rakefile +0 -4
- data/test/rails_app/app/active_record/shim.rb +1 -1
- data/test/rails_app/app/active_record/user_on_engine.rb +7 -0
- data/test/rails_app/app/active_record/user_on_main_app.rb +7 -0
- data/test/rails_app/app/active_record/user_without_email.rb +8 -0
- data/test/rails_app/app/controllers/admins/sessions_controller.rb +1 -1
- data/test/rails_app/app/controllers/admins_controller.rb +0 -5
- data/test/rails_app/app/controllers/application_controller.rb +6 -2
- data/test/rails_app/app/controllers/application_with_fake_engine.rb +30 -0
- data/test/rails_app/app/controllers/custom/registrations_controller.rb +31 -0
- data/test/rails_app/app/controllers/home_controller.rb +1 -1
- data/test/rails_app/app/controllers/publisher/registrations_controller.rb +1 -1
- data/test/rails_app/app/controllers/publisher/sessions_controller.rb +1 -1
- data/test/rails_app/app/controllers/users/omniauth_callbacks_controller.rb +4 -4
- data/test/rails_app/app/controllers/users_controller.rb +12 -4
- data/test/rails_app/app/mailers/users/from_proc_mailer.rb +3 -0
- data/test/rails_app/app/mailers/users/mailer.rb +1 -1
- data/test/rails_app/app/mailers/users/reply_to_mailer.rb +4 -0
- data/test/rails_app/app/mongoid/admin.rb +12 -10
- data/test/rails_app/app/mongoid/shim.rb +4 -5
- data/test/rails_app/app/mongoid/user.rb +19 -22
- data/test/rails_app/app/mongoid/user_on_engine.rb +39 -0
- data/test/rails_app/app/mongoid/user_on_main_app.rb +39 -0
- data/test/rails_app/app/mongoid/user_without_email.rb +33 -0
- data/test/rails_app/app/views/admins/sessions/new.html.erb +1 -1
- data/test/rails_app/app/views/home/admin_dashboard.html.erb +1 -1
- data/test/rails_app/app/views/home/index.html.erb +1 -1
- data/test/rails_app/app/views/home/join.html.erb +1 -1
- data/test/rails_app/app/views/home/user_dashboard.html.erb +1 -1
- data/test/rails_app/app/views/layouts/application.html.erb +1 -1
- data/test/rails_app/app/views/users/edit_form.html.erb +1 -0
- data/test/rails_app/bin/bundle +3 -0
- data/test/rails_app/bin/rails +4 -0
- data/test/rails_app/bin/rake +4 -0
- data/test/rails_app/config/application.rb +4 -5
- data/test/rails_app/config/boot.rb +9 -3
- data/test/rails_app/config/environment.rb +2 -2
- data/test/rails_app/config/environments/development.rb +19 -7
- data/test/rails_app/config/environments/production.rb +68 -17
- data/test/rails_app/config/environments/test.rb +24 -16
- data/test/rails_app/config/initializers/devise.rb +22 -20
- data/test/rails_app/config/initializers/secret_token.rb +8 -2
- data/test/rails_app/config/initializers/session_store.rb +1 -0
- data/test/rails_app/config/routes.rb +71 -46
- data/test/rails_app/db/migrate/20100401102949_create_tables.rb +9 -12
- data/test/rails_app/db/schema.rb +21 -18
- data/test/rails_app/lib/shared_admin.rb +7 -4
- data/test/rails_app/lib/shared_user.rb +6 -3
- data/test/rails_app/lib/shared_user_without_email.rb +26 -0
- data/test/rails_app/lib/shared_user_without_omniauth.rb +13 -0
- data/test/rails_test.rb +9 -0
- data/test/routes_test.rb +94 -78
- data/test/support/action_controller/record_identifier.rb +10 -0
- data/test/support/assertions.rb +2 -3
- data/test/support/helpers.rb +18 -32
- data/test/support/integration.rb +17 -16
- data/test/support/locale/en.yml +4 -0
- data/test/support/mongoid.yml +6 -0
- data/test/test_helper.rb +8 -1
- data/test/test_helpers_test.rb +64 -20
- data/test/test_models.rb +33 -0
- data/test/time_helpers.rb +137 -0
- metadata +172 -51
- data/app/views/devise/_links.erb +0 -3
- data/gemfiles/Gemfile.rails-3.1.x +0 -35
- data/gemfiles/Gemfile.rails-3.1.x.lock +0 -167
- data/lib/devise/models/token_authenticatable.rb +0 -77
- data/lib/devise/strategies/token_authenticatable.rb +0 -56
- data/test/indifferent_hash.rb +0 -33
- data/test/integration/token_authenticatable_test.rb +0 -161
- data/test/models/token_authenticatable_test.rb +0 -55
- data/test/rails_app/script/rails +0 -10
data/test/rails_app/Rakefile
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
module Shim
|
2
|
-
end
|
2
|
+
end
|
@@ -3,6 +3,10 @@
|
|
3
3
|
|
4
4
|
class ApplicationController < ActionController::Base
|
5
5
|
protect_from_forgery
|
6
|
-
before_filter :current_user, :
|
7
|
-
before_filter :authenticate_user!, :
|
6
|
+
before_filter :current_user, unless: :devise_controller?
|
7
|
+
before_filter :authenticate_user!, if: :devise_controller?
|
8
|
+
respond_to *Mime::SET.map(&:to_sym)
|
9
|
+
|
10
|
+
devise_group :commenter, contains: [:user, :admin]
|
8
11
|
end
|
12
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
class ApplicationWithFakeEngine < ApplicationController
|
2
|
+
private
|
3
|
+
|
4
|
+
helper_method :fake_engine
|
5
|
+
def fake_engine
|
6
|
+
@fake_engine ||= FakeEngine.new
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
class FakeEngine
|
11
|
+
def user_on_engine_confirmation_path
|
12
|
+
'/user_on_engine/confirmation'
|
13
|
+
end
|
14
|
+
|
15
|
+
def new_user_on_engine_session_path
|
16
|
+
'/user_on_engine/confirmation/new'
|
17
|
+
end
|
18
|
+
|
19
|
+
def new_user_on_engine_registration_path
|
20
|
+
'/user_on_engine/registration/new'
|
21
|
+
end
|
22
|
+
|
23
|
+
def new_user_on_engine_password_path
|
24
|
+
'/user_on_engine/password/new'
|
25
|
+
end
|
26
|
+
|
27
|
+
def new_user_on_engine_unlock_path
|
28
|
+
'/user_on_engine/unlock/new'
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
class Custom::RegistrationsController < Devise::RegistrationsController
|
2
|
+
def new
|
3
|
+
super do |resource|
|
4
|
+
@new_block_called = true
|
5
|
+
end
|
6
|
+
end
|
7
|
+
|
8
|
+
def create
|
9
|
+
super do |resource|
|
10
|
+
@create_block_called = true
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def update
|
15
|
+
super do |resource|
|
16
|
+
@update_block_called = true
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def create_block_called?
|
21
|
+
@create_block_called == true
|
22
|
+
end
|
23
|
+
|
24
|
+
def update_block_called?
|
25
|
+
@update_block_called == true
|
26
|
+
end
|
27
|
+
|
28
|
+
def new_block_called?
|
29
|
+
@new_block_called == true
|
30
|
+
end
|
31
|
+
end
|
@@ -1,2 +1,2 @@
|
|
1
1
|
class Publisher::RegistrationsController < ApplicationController
|
2
|
-
end
|
2
|
+
end
|
@@ -1,2 +1,2 @@
|
|
1
1
|
class Publisher::SessionsController < ApplicationController
|
2
|
-
end
|
2
|
+
end
|
@@ -2,13 +2,13 @@ class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
|
|
2
2
|
def facebook
|
3
3
|
data = env["omniauth.auth"]
|
4
4
|
session["devise.facebook_data"] = data["extra"]["user_hash"]
|
5
|
-
render :
|
5
|
+
render json: data
|
6
6
|
end
|
7
7
|
|
8
8
|
def sign_in_facebook
|
9
|
-
user = User.
|
9
|
+
user = User.to_adapter.find_first(email: 'user@test.com')
|
10
10
|
user.remember_me = true
|
11
11
|
sign_in user
|
12
|
-
render :
|
12
|
+
render text: ""
|
13
13
|
end
|
14
|
-
end
|
14
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
class UsersController < ApplicationController
|
2
|
-
prepend_before_filter :current_user, :
|
3
|
-
before_filter :authenticate_user!, :
|
2
|
+
prepend_before_filter :current_user, only: :exhibit
|
3
|
+
before_filter :authenticate_user!, except: [:accept, :exhibit]
|
4
4
|
respond_to :html, :xml
|
5
5
|
|
6
6
|
def index
|
@@ -8,16 +8,24 @@ class UsersController < ApplicationController
|
|
8
8
|
respond_with(current_user)
|
9
9
|
end
|
10
10
|
|
11
|
+
def edit_form
|
12
|
+
user_session['last_request_at'] = params.fetch(:last_request_at, 31.minutes.ago.utc)
|
13
|
+
end
|
14
|
+
|
15
|
+
def update_form
|
16
|
+
render text: 'Update'
|
17
|
+
end
|
18
|
+
|
11
19
|
def accept
|
12
20
|
@current_user = current_user
|
13
21
|
end
|
14
22
|
|
15
23
|
def exhibit
|
16
|
-
render :
|
24
|
+
render text: current_user ? "User is authenticated" : "User is not authenticated"
|
17
25
|
end
|
18
26
|
|
19
27
|
def expire
|
20
28
|
user_session['last_request_at'] = 31.minutes.ago.utc
|
21
|
-
render :
|
29
|
+
render text: 'User will be expired on next request'
|
22
30
|
end
|
23
31
|
end
|
@@ -6,22 +6,24 @@ class Admin
|
|
6
6
|
include SharedAdmin
|
7
7
|
|
8
8
|
## Database authenticatable
|
9
|
-
field :email, :
|
10
|
-
field :encrypted_password, :
|
9
|
+
field :email, type: String
|
10
|
+
field :encrypted_password, type: String
|
11
11
|
|
12
12
|
## Recoverable
|
13
|
-
field :reset_password_token, :
|
14
|
-
field :reset_password_sent_at, :
|
13
|
+
field :reset_password_token, type: String
|
14
|
+
field :reset_password_sent_at, type: Time
|
15
15
|
|
16
16
|
## Rememberable
|
17
|
-
field :remember_created_at, :
|
17
|
+
field :remember_created_at, type: Time
|
18
18
|
|
19
19
|
## Confirmable
|
20
|
-
field :confirmation_token, :
|
21
|
-
field :confirmed_at, :
|
22
|
-
field :confirmation_sent_at, :
|
23
|
-
field :unconfirmed_email, :
|
20
|
+
field :confirmation_token, type: String
|
21
|
+
field :confirmed_at, type: Time
|
22
|
+
field :confirmation_sent_at, type: Time
|
23
|
+
field :unconfirmed_email, type: String # Only if using reconfirmable
|
24
24
|
|
25
25
|
## Lockable
|
26
|
-
field :locked_at, :
|
26
|
+
field :locked_at, type: Time
|
27
|
+
|
28
|
+
field :active, type: Boolean, default: false
|
27
29
|
end
|
@@ -3,17 +3,16 @@ module Shim
|
|
3
3
|
|
4
4
|
included do
|
5
5
|
include ::Mongoid::Timestamps
|
6
|
-
field :created_at, :
|
6
|
+
field :created_at, type: DateTime
|
7
7
|
end
|
8
8
|
|
9
9
|
module ClassMethods
|
10
|
-
def
|
11
|
-
|
12
|
-
super(options)
|
10
|
+
def order(attribute)
|
11
|
+
asc(attribute)
|
13
12
|
end
|
14
13
|
|
15
14
|
def find_by_email(email)
|
16
|
-
|
15
|
+
find_by(email: email)
|
17
16
|
end
|
18
17
|
end
|
19
18
|
|
@@ -5,38 +5,35 @@ class User
|
|
5
5
|
include Shim
|
6
6
|
include SharedUser
|
7
7
|
|
8
|
-
field :username, :
|
9
|
-
field :facebook_token, :
|
8
|
+
field :username, type: String
|
9
|
+
field :facebook_token, type: String
|
10
10
|
|
11
11
|
## Database authenticatable
|
12
|
-
field :email, :
|
13
|
-
field :encrypted_password, :
|
12
|
+
field :email, type: String, default: ""
|
13
|
+
field :encrypted_password, type: String, default: ""
|
14
14
|
|
15
15
|
## Recoverable
|
16
|
-
field :reset_password_token, :
|
17
|
-
field :reset_password_sent_at, :
|
16
|
+
field :reset_password_token, type: String
|
17
|
+
field :reset_password_sent_at, type: Time
|
18
18
|
|
19
19
|
## Rememberable
|
20
|
-
field :remember_created_at, :
|
20
|
+
field :remember_created_at, type: Time
|
21
21
|
|
22
22
|
## Trackable
|
23
|
-
field :sign_in_count, :
|
24
|
-
field :current_sign_in_at, :
|
25
|
-
field :last_sign_in_at, :
|
26
|
-
field :current_sign_in_ip, :
|
27
|
-
field :last_sign_in_ip, :
|
23
|
+
field :sign_in_count, type: Integer, default: 0
|
24
|
+
field :current_sign_in_at, type: Time
|
25
|
+
field :last_sign_in_at, type: Time
|
26
|
+
field :current_sign_in_ip, type: String
|
27
|
+
field :last_sign_in_ip, type: String
|
28
28
|
|
29
29
|
## Confirmable
|
30
|
-
field :confirmation_token, :
|
31
|
-
field :confirmed_at, :
|
32
|
-
field :confirmation_sent_at, :
|
33
|
-
# field :unconfirmed_email, :
|
30
|
+
field :confirmation_token, type: String
|
31
|
+
field :confirmed_at, type: Time
|
32
|
+
field :confirmation_sent_at, type: Time
|
33
|
+
# field :unconfirmed_email, type: String # Only if using reconfirmable
|
34
34
|
|
35
35
|
## Lockable
|
36
|
-
field :failed_attempts, :
|
37
|
-
field :unlock_token, :
|
38
|
-
field :locked_at, :
|
39
|
-
|
40
|
-
## Token authenticatable
|
41
|
-
field :authentication_token, :type => String
|
36
|
+
field :failed_attempts, type: Integer, default: 0 # Only if lock strategy is :failed_attempts
|
37
|
+
field :unlock_token, type: String # Only if unlock strategy is :email or :both
|
38
|
+
field :locked_at, type: Time
|
42
39
|
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'shared_user_without_omniauth'
|
2
|
+
|
3
|
+
class UserOnEngine
|
4
|
+
include Mongoid::Document
|
5
|
+
include Shim
|
6
|
+
include SharedUserWithoutOmniauth
|
7
|
+
|
8
|
+
field :username, type: String
|
9
|
+
field :facebook_token, type: String
|
10
|
+
|
11
|
+
## Database authenticatable
|
12
|
+
field :email, type: String, default: ""
|
13
|
+
field :encrypted_password, type: String, default: ""
|
14
|
+
|
15
|
+
## Recoverable
|
16
|
+
field :reset_password_token, type: String
|
17
|
+
field :reset_password_sent_at, type: Time
|
18
|
+
|
19
|
+
## Rememberable
|
20
|
+
field :remember_created_at, type: Time
|
21
|
+
|
22
|
+
## Trackable
|
23
|
+
field :sign_in_count, type: Integer, default: 0
|
24
|
+
field :current_sign_in_at, type: Time
|
25
|
+
field :last_sign_in_at, type: Time
|
26
|
+
field :current_sign_in_ip, type: String
|
27
|
+
field :last_sign_in_ip, type: String
|
28
|
+
|
29
|
+
## Confirmable
|
30
|
+
field :confirmation_token, type: String
|
31
|
+
field :confirmed_at, type: Time
|
32
|
+
field :confirmation_sent_at, type: Time
|
33
|
+
# field :unconfirmed_email, type: String # Only if using reconfirmable
|
34
|
+
|
35
|
+
## Lockable
|
36
|
+
field :failed_attempts, type: Integer, default: 0 # Only if lock strategy is :failed_attempts
|
37
|
+
field :unlock_token, type: String # Only if unlock strategy is :email or :both
|
38
|
+
field :locked_at, type: Time
|
39
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'shared_user_without_omniauth'
|
2
|
+
|
3
|
+
class UserOnMainApp
|
4
|
+
include Mongoid::Document
|
5
|
+
include Shim
|
6
|
+
include SharedUserWithoutOmniauth
|
7
|
+
|
8
|
+
field :username, type: String
|
9
|
+
field :facebook_token, type: String
|
10
|
+
|
11
|
+
## Database authenticatable
|
12
|
+
field :email, type: String, default: ""
|
13
|
+
field :encrypted_password, type: String, default: ""
|
14
|
+
|
15
|
+
## Recoverable
|
16
|
+
field :reset_password_token, type: String
|
17
|
+
field :reset_password_sent_at, type: Time
|
18
|
+
|
19
|
+
## Rememberable
|
20
|
+
field :remember_created_at, type: Time
|
21
|
+
|
22
|
+
## Trackable
|
23
|
+
field :sign_in_count, type: Integer, default: 0
|
24
|
+
field :current_sign_in_at, type: Time
|
25
|
+
field :last_sign_in_at, type: Time
|
26
|
+
field :current_sign_in_ip, type: String
|
27
|
+
field :last_sign_in_ip, type: String
|
28
|
+
|
29
|
+
## Confirmable
|
30
|
+
field :confirmation_token, type: String
|
31
|
+
field :confirmed_at, type: Time
|
32
|
+
field :confirmation_sent_at, type: Time
|
33
|
+
# field :unconfirmed_email, type: String # Only if using reconfirmable
|
34
|
+
|
35
|
+
## Lockable
|
36
|
+
field :failed_attempts, type: Integer, default: 0 # Only if lock strategy is :failed_attempts
|
37
|
+
field :unlock_token, type: String # Only if unlock strategy is :email or :both
|
38
|
+
field :locked_at, type: Time
|
39
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require "shared_user_without_email"
|
2
|
+
|
3
|
+
class UserWithoutEmail
|
4
|
+
include Mongoid::Document
|
5
|
+
include Shim
|
6
|
+
include SharedUserWithoutEmail
|
7
|
+
|
8
|
+
field :username, type: String
|
9
|
+
field :facebook_token, type: String
|
10
|
+
|
11
|
+
## Database authenticatable
|
12
|
+
field :email, type: String, default: ""
|
13
|
+
field :encrypted_password, type: String, default: ""
|
14
|
+
|
15
|
+
## Recoverable
|
16
|
+
field :reset_password_token, type: String
|
17
|
+
field :reset_password_sent_at, type: Time
|
18
|
+
|
19
|
+
## Rememberable
|
20
|
+
field :remember_created_at, type: Time
|
21
|
+
|
22
|
+
## Trackable
|
23
|
+
field :sign_in_count, type: Integer, default: 0
|
24
|
+
field :current_sign_in_at, type: Time
|
25
|
+
field :last_sign_in_at, type: Time
|
26
|
+
field :current_sign_in_ip, type: String
|
27
|
+
field :last_sign_in_ip, type: String
|
28
|
+
|
29
|
+
## Lockable
|
30
|
+
field :failed_attempts, type: Integer, default: 0 # Only if lock strategy is :failed_attempts
|
31
|
+
field :unlock_token, type: String # Only if unlock strategy is :email or :both
|
32
|
+
field :locked_at, type: Time
|
33
|
+
end
|