devise_token_auth 0.1.41 → 0.1.42
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of devise_token_auth might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/devise_token_auth/version.rb +1 -1
- data/test/controllers/devise_token_auth/passwords_controller_test.rb +3 -3
- data/test/dummy/tmp/generators/app/models/user.rb +11 -0
- data/test/dummy/tmp/generators/config/initializers/devise_token_auth.rb +48 -0
- data/test/dummy/tmp/generators/db/migrate/20170517171822_devise_token_auth_create_users.rb +54 -0
- metadata +10 -8
- data/test/dummy/tmp/generators/app/views/devise/mailer/confirmation_instructions.html.erb +0 -5
- data/test/dummy/tmp/generators/app/views/devise/mailer/reset_password_instructions.html.erb +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e417664fd64bb5d235bbb2e071516172ff8125b
|
4
|
+
data.tar.gz: e75006fbdcf1b00f00117db24fce2410eb257162
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7aa61841da344dd20e7921d74c98e015b6c21a0efe662e8bf2b1b7e4b5f27c4c0da53ed009a7df803b7aa97a969c834d93918a05e825618c65c92870725d90a8
|
7
|
+
data.tar.gz: cd4cc39794d409dd91016fba7e4cbcd8c5568f6180ba5346559f22dfd18b6800a04a5a9785e699ead20008554d36f0dc849e0bee3f46bd82d3248c3a9aaa223f
|
@@ -83,9 +83,9 @@ class DeviseTokenAuth::PasswordsControllerTest < ActionController::TestCase
|
|
83
83
|
@data = JSON.parse(response.body)
|
84
84
|
end
|
85
85
|
|
86
|
-
|
87
|
-
|
88
|
-
|
86
|
+
test 'response should not contain extra data' do
|
87
|
+
assert_nil @data["data"]
|
88
|
+
end
|
89
89
|
end
|
90
90
|
|
91
91
|
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class User < ActiveRecord::Base
|
2
|
+
# Include default devise modules.
|
3
|
+
devise :database_authenticatable, :registerable,
|
4
|
+
:recoverable, :rememberable, :trackable, :validatable,
|
5
|
+
:confirmable, :omniauthable
|
6
|
+
include DeviseTokenAuth::Concerns::User
|
7
|
+
|
8
|
+
def whatever
|
9
|
+
puts 'whatever'
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
DeviseTokenAuth.setup do |config|
|
2
|
+
# By default the authorization headers will change after each request. The
|
3
|
+
# client is responsible for keeping track of the changing tokens. Change
|
4
|
+
# this to false to prevent the Authorization header from changing after
|
5
|
+
# each request.
|
6
|
+
# config.change_headers_on_each_request = true
|
7
|
+
|
8
|
+
# By default, users will need to re-authenticate after 2 weeks. This setting
|
9
|
+
# determines how long tokens will remain valid after they are issued.
|
10
|
+
# config.token_lifespan = 2.weeks
|
11
|
+
|
12
|
+
# Sets the max number of concurrent devices per user, which is 10 by default.
|
13
|
+
# After this limit is reached, the oldest tokens will be removed.
|
14
|
+
# config.max_number_of_devices = 10
|
15
|
+
|
16
|
+
# Sometimes it's necessary to make several requests to the API at the same
|
17
|
+
# time. In this case, each request in the batch will need to share the same
|
18
|
+
# auth token. This setting determines how far apart the requests can be while
|
19
|
+
# still using the same auth token.
|
20
|
+
# config.batch_request_buffer_throttle = 5.seconds
|
21
|
+
|
22
|
+
# This route will be the prefix for all oauth2 redirect callbacks. For
|
23
|
+
# example, using the default '/omniauth', the github oauth2 provider will
|
24
|
+
# redirect successful authentications to '/omniauth/github/callback'
|
25
|
+
# config.omniauth_prefix = "/omniauth"
|
26
|
+
|
27
|
+
# By default sending current password is not needed for the password update.
|
28
|
+
# Uncomment to enforce current_password param to be checked before all
|
29
|
+
# attribute updates. Set it to :password if you want it to be checked only if
|
30
|
+
# password is updated.
|
31
|
+
# config.check_current_password_before_update = :attributes
|
32
|
+
|
33
|
+
# By default we will use callbacks for single omniauth.
|
34
|
+
# It depends on fields like email, provider and uid.
|
35
|
+
# config.default_callbacks = true
|
36
|
+
|
37
|
+
# Makes it possible to change the headers names
|
38
|
+
# config.headers_names = {:'access-token' => 'access-token',
|
39
|
+
# :'client' => 'client',
|
40
|
+
# :'expiry' => 'expiry',
|
41
|
+
# :'uid' => 'uid',
|
42
|
+
# :'token-type' => 'token-type' }
|
43
|
+
|
44
|
+
# By default, only Bearer Token authentication is implemented out of the box.
|
45
|
+
# If, however, you wish to integrate with legacy Devise authentication, you can
|
46
|
+
# do so by enabling this flag. NOTE: This feature is highly experimental!
|
47
|
+
# config.enable_standard_devise_support = false
|
48
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
class DeviseTokenAuthCreateUsers < ActiveRecord::Migration[4.2]
|
2
|
+
def change
|
3
|
+
create_table(:users) do |t|
|
4
|
+
## Required
|
5
|
+
t.string :provider, :null => false, :default => "email"
|
6
|
+
t.string :uid, :null => false, :default => ""
|
7
|
+
|
8
|
+
## Database authenticatable
|
9
|
+
t.string :encrypted_password, :null => false, :default => ""
|
10
|
+
|
11
|
+
## Recoverable
|
12
|
+
t.string :reset_password_token
|
13
|
+
t.datetime :reset_password_sent_at
|
14
|
+
|
15
|
+
## Rememberable
|
16
|
+
t.datetime :remember_created_at
|
17
|
+
|
18
|
+
## Trackable
|
19
|
+
t.integer :sign_in_count, :default => 0, :null => false
|
20
|
+
t.datetime :current_sign_in_at
|
21
|
+
t.datetime :last_sign_in_at
|
22
|
+
t.string :current_sign_in_ip
|
23
|
+
t.string :last_sign_in_ip
|
24
|
+
|
25
|
+
## Confirmable
|
26
|
+
t.string :confirmation_token
|
27
|
+
t.datetime :confirmed_at
|
28
|
+
t.datetime :confirmation_sent_at
|
29
|
+
t.string :unconfirmed_email # Only if using reconfirmable
|
30
|
+
|
31
|
+
## Lockable
|
32
|
+
# t.integer :failed_attempts, :default => 0, :null => false # Only if lock strategy is :failed_attempts
|
33
|
+
# t.string :unlock_token # Only if unlock strategy is :email or :both
|
34
|
+
# t.datetime :locked_at
|
35
|
+
|
36
|
+
## User Info
|
37
|
+
t.string :name
|
38
|
+
t.string :nickname
|
39
|
+
t.string :image
|
40
|
+
t.string :email
|
41
|
+
|
42
|
+
## Tokens
|
43
|
+
t.text :tokens
|
44
|
+
|
45
|
+
t.timestamps
|
46
|
+
end
|
47
|
+
|
48
|
+
add_index :users, :email, unique: true
|
49
|
+
add_index :users, [:uid, :provider], unique: true
|
50
|
+
add_index :users, :reset_password_token, unique: true
|
51
|
+
add_index :users, :confirmation_token, unique: true
|
52
|
+
# add_index :users, :unlock_token, unique: true
|
53
|
+
end
|
54
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise_token_auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.42
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lynn Hurley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -33,7 +33,7 @@ dependencies:
|
|
33
33
|
version: 3.5.2
|
34
34
|
- - "<="
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version: 4.
|
36
|
+
version: '4.3'
|
37
37
|
type: :runtime
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: 3.5.2
|
44
44
|
- - "<="
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: 4.
|
46
|
+
version: '4.3'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: sqlite3
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -227,8 +227,9 @@ files:
|
|
227
227
|
- test/dummy/db/migrate/20160629184441_devise_token_auth_create_lockable_users.rb
|
228
228
|
- test/dummy/db/schema.rb
|
229
229
|
- test/dummy/lib/migration_database_helper.rb
|
230
|
-
- test/dummy/tmp/generators/app/
|
231
|
-
- test/dummy/tmp/generators/
|
230
|
+
- test/dummy/tmp/generators/app/models/user.rb
|
231
|
+
- test/dummy/tmp/generators/config/initializers/devise_token_auth.rb
|
232
|
+
- test/dummy/tmp/generators/db/migrate/20170517171822_devise_token_auth_create_users.rb
|
232
233
|
- test/integration/navigation_test.rb
|
233
234
|
- test/lib/devise_token_auth/url_test.rb
|
234
235
|
- test/lib/generators/devise_token_auth/install_generator_test.rb
|
@@ -346,8 +347,9 @@ test_files:
|
|
346
347
|
- test/dummy/db/schema.rb
|
347
348
|
- test/dummy/lib/migration_database_helper.rb
|
348
349
|
- test/dummy/README.rdoc
|
349
|
-
- test/dummy/tmp/generators/app/
|
350
|
-
- test/dummy/tmp/generators/
|
350
|
+
- test/dummy/tmp/generators/app/models/user.rb
|
351
|
+
- test/dummy/tmp/generators/config/initializers/devise_token_auth.rb
|
352
|
+
- test/dummy/tmp/generators/db/migrate/20170517171822_devise_token_auth_create_users.rb
|
351
353
|
- test/integration/navigation_test.rb
|
352
354
|
- test/lib/devise_token_auth/url_test.rb
|
353
355
|
- test/lib/generators/devise_token_auth/install_generator_test.rb
|
@@ -1,5 +0,0 @@
|
|
1
|
-
<p><%= t(:welcome).capitalize + ' ' + @email %>!</p>
|
2
|
-
|
3
|
-
<p><%= t '.confirm_link_msg' %> </p>
|
4
|
-
|
5
|
-
<p><%= link_to t('.confirm_account_link'), confirmation_url(@resource, {confirmation_token: @token, config: message['client-config'].to_s, redirect_url: message['redirect-url']}).html_safe %></p>
|
@@ -1,8 +0,0 @@
|
|
1
|
-
<p><%= t(:hello).capitalize %> <%= @resource.email %>!</p>
|
2
|
-
|
3
|
-
<p><%= t '.request_reset_link_msg' %></p>
|
4
|
-
|
5
|
-
<p><%= link_to t('.password_change_link'), edit_password_url(@resource, reset_password_token: @token, config: message['client-config'].to_s, redirect_url: message['redirect-url'].to_s).html_safe %></p>
|
6
|
-
|
7
|
-
<p><%= t '.ignore_mail_msg' %></p>
|
8
|
-
<p><%= t '.no_changes_msg' %></p>
|