devise_token_auth 0.1.43 → 0.2.0
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/README.md +40 -894
- data/Rakefile +2 -0
- data/app/controllers/devise_token_auth/application_controller.rb +6 -0
- data/app/controllers/devise_token_auth/concerns/resource_finder.rb +2 -0
- data/app/controllers/devise_token_auth/concerns/set_user_by_token.rb +9 -14
- data/app/controllers/devise_token_auth/confirmations_controller.rb +3 -1
- data/app/controllers/devise_token_auth/omniauth_callbacks_controller.rb +2 -0
- data/app/controllers/devise_token_auth/passwords_controller.rb +8 -14
- data/app/controllers/devise_token_auth/registrations_controller.rb +26 -21
- data/app/controllers/devise_token_auth/sessions_controller.rb +2 -0
- data/app/controllers/devise_token_auth/token_validations_controller.rb +2 -0
- data/app/controllers/devise_token_auth/unlocks_controller.rb +2 -0
- data/app/models/devise_token_auth/concerns/user.rb +41 -16
- data/app/models/devise_token_auth/concerns/user_omniauth_callbacks.rb +2 -0
- data/app/validators/email_validator.rb +3 -1
- data/config/initializers/devise.rb +2 -0
- data/config/locales/da-DK.yml +1 -1
- data/config/locales/sv.yml +50 -0
- data/lib/devise_token_auth.rb +3 -0
- data/lib/devise_token_auth/controllers/helpers.rb +2 -0
- data/lib/devise_token_auth/controllers/url_helpers.rb +2 -0
- data/lib/devise_token_auth/engine.rb +2 -0
- data/lib/devise_token_auth/errors.rb +7 -0
- data/lib/devise_token_auth/rails/routes.rb +2 -0
- data/lib/devise_token_auth/url.rb +2 -0
- data/lib/devise_token_auth/version.rb +3 -1
- data/lib/generators/devise_token_auth/USAGE +1 -1
- data/lib/generators/devise_token_auth/install_generator.rb +7 -5
- data/lib/generators/devise_token_auth/install_views_generator.rb +2 -0
- data/lib/generators/devise_token_auth/templates/devise_token_auth.rb +2 -0
- data/lib/generators/devise_token_auth/templates/devise_token_auth_create_users.rb.erb +8 -7
- data/lib/generators/devise_token_auth/templates/user.rb +3 -1
- data/lib/tasks/devise_token_auth_tasks.rake +2 -0
- data/test/controllers/custom/custom_confirmations_controller_test.rb +2 -0
- data/test/controllers/custom/custom_omniauth_callbacks_controller_test.rb +2 -0
- data/test/controllers/custom/custom_passwords_controller_test.rb +2 -0
- data/test/controllers/custom/custom_registrations_controller_test.rb +11 -0
- data/test/controllers/custom/custom_sessions_controller_test.rb +2 -0
- data/test/controllers/custom/custom_token_validations_controller_test.rb +2 -0
- data/test/controllers/demo_group_controller_test.rb +2 -0
- data/test/controllers/demo_mang_controller_test.rb +4 -1
- data/test/controllers/demo_user_controller_test.rb +47 -10
- data/test/controllers/devise_token_auth/confirmations_controller_test.rb +4 -6
- data/test/controllers/devise_token_auth/omniauth_callbacks_controller_test.rb +7 -4
- data/test/controllers/devise_token_auth/passwords_controller_test.rb +2 -0
- data/test/controllers/devise_token_auth/registrations_controller_test.rb +3 -1
- data/test/controllers/devise_token_auth/sessions_controller_test.rb +52 -0
- data/test/controllers/devise_token_auth/token_validations_controller_test.rb +2 -0
- data/test/controllers/devise_token_auth/unlocks_controller_test.rb +2 -0
- data/test/controllers/overrides/confirmations_controller_test.rb +2 -0
- data/test/controllers/overrides/omniauth_callbacks_controller_test.rb +2 -0
- data/test/controllers/overrides/passwords_controller_test.rb +2 -0
- data/test/controllers/overrides/registrations_controller_test.rb +31 -27
- data/test/controllers/overrides/sessions_controller_test.rb +2 -0
- data/test/controllers/overrides/token_validations_controller_test.rb +2 -0
- data/test/dummy/app/controllers/application_controller.rb +2 -0
- data/test/dummy/app/controllers/auth_origin_controller.rb +2 -0
- data/test/dummy/app/controllers/custom/confirmations_controller.rb +2 -0
- data/test/dummy/app/controllers/custom/omniauth_callbacks_controller.rb +2 -0
- data/test/dummy/app/controllers/custom/passwords_controller.rb +2 -0
- data/test/dummy/app/controllers/custom/registrations_controller.rb +2 -1
- data/test/dummy/app/controllers/custom/sessions_controller.rb +2 -0
- data/test/dummy/app/controllers/custom/token_validations_controller.rb +2 -0
- data/test/dummy/app/controllers/demo_group_controller.rb +2 -0
- data/test/dummy/app/controllers/demo_mang_controller.rb +2 -0
- data/test/dummy/app/controllers/demo_user_controller.rb +2 -0
- data/test/dummy/app/controllers/overrides/confirmations_controller.rb +2 -0
- data/test/dummy/app/controllers/overrides/omniauth_callbacks_controller.rb +2 -0
- data/test/dummy/app/controllers/overrides/passwords_controller.rb +2 -0
- data/test/dummy/app/controllers/overrides/registrations_controller.rb +2 -0
- data/test/dummy/app/controllers/overrides/sessions_controller.rb +2 -0
- data/test/dummy/app/controllers/overrides/token_validations_controller.rb +2 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/models/evil_user.rb +2 -0
- data/test/dummy/app/models/lockable_user.rb +2 -0
- data/test/dummy/app/models/mang.rb +2 -0
- data/test/dummy/app/models/nice_user.rb +2 -0
- data/test/dummy/app/models/only_email_user.rb +2 -0
- data/test/dummy/app/models/scoped_user.rb +2 -0
- data/test/dummy/app/models/unconfirmable_user.rb +2 -0
- data/test/dummy/app/models/unregisterable_user.rb +2 -0
- data/test/dummy/app/models/user.rb +2 -0
- data/test/dummy/config/application.rb +2 -0
- data/test/dummy/config/boot.rb +2 -0
- data/test/dummy/config/environment.rb +2 -0
- data/test/dummy/config/environments/development.rb +2 -0
- data/test/dummy/config/environments/production.rb +2 -0
- data/test/dummy/config/environments/test.rb +2 -0
- data/test/dummy/config/initializers/assets.rb +2 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +2 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +3 -1
- data/test/dummy/config/initializers/devise.rb +2 -0
- data/test/dummy/config/initializers/devise_token_auth.rb +2 -0
- data/test/dummy/config/initializers/figaro.rb +2 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +2 -0
- data/test/dummy/config/initializers/inflections.rb +2 -0
- data/test/dummy/config/initializers/mime_types.rb +2 -0
- data/test/dummy/config/initializers/omniauth.rb +2 -0
- data/test/dummy/config/initializers/session_store.rb +2 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +2 -0
- data/test/dummy/config/routes.rb +2 -0
- data/test/dummy/config/spring.rb +2 -0
- data/test/dummy/db/migrate/20140715061447_devise_token_auth_create_users.rb +2 -0
- data/test/dummy/db/migrate/20140715061805_devise_token_auth_create_mangs.rb +2 -0
- data/test/dummy/db/migrate/20140829044006_add_operating_thetan_to_user.rb +2 -0
- data/test/dummy/db/migrate/20140916224624_add_favorite_color_to_mangs.rb +2 -0
- data/test/dummy/db/migrate/20140928231203_devise_token_auth_create_evil_users.rb +2 -0
- data/test/dummy/db/migrate/20141222035835_devise_token_auth_create_only_email_users.rb +2 -0
- data/test/dummy/db/migrate/20141222053502_devise_token_auth_create_unregisterable_users.rb +2 -0
- data/test/dummy/db/migrate/20150409095712_devise_token_auth_create_nice_users.rb +2 -0
- data/test/dummy/db/migrate/20150708104536_devise_token_auth_create_unconfirmable_users.rb +2 -0
- data/test/dummy/db/migrate/20160103235141_devise_token_auth_create_scoped_users.rb +2 -0
- data/test/dummy/db/migrate/20160629184441_devise_token_auth_create_lockable_users.rb +2 -0
- data/test/dummy/lib/migration_database_helper.rb +15 -1
- data/test/dummy/tmp/generators/app/models/user.rb +5 -5
- data/test/dummy/tmp/generators/config/initializers/devise_token_auth.rb +2 -0
- data/test/dummy/tmp/generators/db/migrate/{20171014052631_devise_token_auth_create_users.rb → 20180805205504_devise_token_auth_create_users.rb} +1 -0
- data/test/integration/navigation_test.rb +2 -0
- data/test/lib/devise_token_auth/url_test.rb +2 -0
- data/test/lib/generators/devise_token_auth/install_generator_test.rb +2 -0
- data/test/lib/generators/devise_token_auth/install_generator_with_namespace_test.rb +194 -0
- data/test/lib/generators/devise_token_auth/install_views_generator_test.rb +2 -0
- data/test/models/only_email_user_test.rb +2 -0
- data/test/models/user_test.rb +6 -4
- data/test/test_helper.rb +30 -14
- metadata +23 -5
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'test_helper'
|
2
4
|
|
3
5
|
# was the web request successful?
|
@@ -8,33 +10,35 @@ require 'test_helper'
|
|
8
10
|
|
9
11
|
class Overrides::RegistrationsControllerTest < ActionDispatch::IntegrationTest
|
10
12
|
describe Overrides::RegistrationsController do
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
13
|
+
describe 'Succesful Registration update' do
|
14
|
+
setup do
|
15
|
+
@existing_user = evil_users(:confirmed_email_user)
|
16
|
+
@auth_headers = @existing_user.create_new_auth_token
|
17
|
+
@client_id = @auth_headers['client']
|
18
|
+
@favorite_color = 'pink'
|
19
|
+
|
20
|
+
# ensure request is not treated as batch request
|
21
|
+
age_token(@existing_user, @client_id)
|
22
|
+
|
23
|
+
# test valid update param
|
24
|
+
@new_operating_thetan = 1_000_000
|
25
|
+
|
26
|
+
put '/evil_user_auth',
|
27
|
+
params: { favorite_color: @favorite_color },
|
28
|
+
headers: @auth_headers
|
29
|
+
|
30
|
+
@data = JSON.parse(response.body)
|
31
|
+
@existing_user.reload
|
32
|
+
end
|
33
|
+
|
34
|
+
test 'user was updated' do
|
35
|
+
assert_equal @favorite_color, @existing_user.favorite_color
|
36
|
+
end
|
37
|
+
|
38
|
+
test 'controller was overridden' do
|
39
|
+
assert_equal Overrides::RegistrationsController::OVERRIDE_PROOF,
|
40
|
+
@data['override_proof']
|
41
|
+
end
|
38
42
|
end
|
39
43
|
end
|
40
44
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class Custom::RegistrationsController < DeviseTokenAuth::RegistrationsController
|
2
4
|
|
3
5
|
def create
|
@@ -35,5 +37,4 @@ class Custom::RegistrationsController < DeviseTokenAuth::RegistrationsController
|
|
35
37
|
def render_create_success
|
36
38
|
render json: {custom: "foo"}
|
37
39
|
end
|
38
|
-
|
39
40
|
end
|
data/test/dummy/config/boot.rb
CHANGED