diff --git a/app/controllers/devise_token_auth/confirmations_controller.rb b/app/controllers/devise_token_auth/confirmations_controller.rb index c1a0ba6c7..aa17e8af6 100644 --- a/app/controllers/devise_token_auth/confirmations_controller.rb +++ b/app/controllers/devise_token_auth/confirmations_controller.rb @@ -13,6 +13,7 @@ def show if signed_in?(resource_name) token = signed_in_resource.create_token + signed_in_resource.save! redirect_headers = build_redirect_headers(token.token, token.client, diff --git a/test/controllers/devise_token_auth/confirmations_controller_test.rb b/test/controllers/devise_token_auth/confirmations_controller_test.rb index 29ef2b8aa..7da4341e5 100644 --- a/test/controllers/devise_token_auth/confirmations_controller_test.rb +++ b/test/controllers/devise_token_auth/confirmations_controller_test.rb @@ -53,6 +53,10 @@ def token_and_client_config_from(body) assert @resource.confirmed? end + test 'should save the authentication token' do + assert @resource.reload.tokens.present? + end + test 'should redirect to success url' do assert_redirected_to(/^#{@redirect_url}/) end