-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When we edit user password (after asking reset). Do not run skip_conf…
…irmation! is the user is not :confirmable
- Loading branch information
Sébastien Fieloux
committed
Jul 8, 2015
1 parent
62f3d13
commit b3b98bb
Showing
7 changed files
with
138 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
class UnconfirmableUser < ActiveRecord::Base | ||
# Include default devise modules. | ||
devise :database_authenticatable, :registerable, | ||
:recoverable, :rememberable, | ||
:trackable, :validatable, | ||
:omniauthable | ||
include DeviseTokenAuth::Concerns::User | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
test/dummy/db/migrate/20150708104536_devise_token_auth_create_unconfirmable_users.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
class DeviseTokenAuthCreateUnconfirmableUsers < ActiveRecord::Migration | ||
def change | ||
create_table(:unconfirmable_users) do |t| | ||
## Required | ||
t.string :provider, :null => false | ||
t.string :uid, :null => false, :default => "" | ||
|
||
## Database authenticatable | ||
t.string :encrypted_password, :null => false, :default => "" | ||
|
||
## Recoverable | ||
t.string :reset_password_token | ||
t.datetime :reset_password_sent_at | ||
|
||
## Rememberable | ||
t.datetime :remember_created_at | ||
|
||
## Trackable | ||
t.integer :sign_in_count, :default => 0, :null => false | ||
t.datetime :current_sign_in_at | ||
t.datetime :last_sign_in_at | ||
t.string :current_sign_in_ip | ||
t.string :last_sign_in_ip | ||
|
||
## Confirmable | ||
# t.string :confirmation_token | ||
# t.datetime :confirmed_at | ||
# t.datetime :confirmation_sent_at | ||
# t.string :unconfirmed_email # Only if using reconfirmable | ||
|
||
## Lockable | ||
# t.integer :failed_attempts, :default => 0, :null => false # Only if lock strategy is :failed_attempts | ||
# t.string :unlock_token # Only if unlock strategy is :email or :both | ||
# t.datetime :locked_at | ||
|
||
## User Info | ||
t.string :name | ||
t.string :nickname | ||
t.string :image | ||
t.string :email | ||
|
||
## Tokens | ||
t.text :tokens | ||
|
||
t.timestamps | ||
end | ||
|
||
add_index :unconfirmable_users, :email | ||
add_index :unconfirmable_users, [:uid, :provider], :unique => true | ||
add_index :unconfirmable_users, :reset_password_token, :unique => true | ||
# add_index :nice_users, :confirmation_token, :unique => true | ||
# add_index :nice_users, :unlock_token, :unique => true | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<% timestamp = DateTime.parse(2.weeks.ago.to_s).to_time.strftime("%F %T") %> | ||
<% @email = Faker::Internet.email %> | ||
user: | ||
uid: "<%= @email %>" | ||
email: "<%= @email %>" | ||
provider: 'email' | ||
created_at: '<%= timestamp %>' | ||
updated_at: '<%= timestamp %>' | ||
encrypted_password: <%= User.new.send(:password_digest, 'secret123') %> |