From 9c22da0ac6cac771f279019daeef320981345cd2 Mon Sep 17 00:00:00 2001 From: AlexisChavez97 <31967792+AlexisChavez97@users.noreply.github.com> Date: Tue, 22 Oct 2019 02:02:06 -0500 Subject: [PATCH] Fix #52 rubocop metrics abc size in passwords controller (#119) * Fix #52 rubocop metrics abc size in passwords controller * Fix DeviseTokenAuth headers names --- app/controllers/passwords_controller.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/controllers/passwords_controller.rb b/app/controllers/passwords_controller.rb index 84b2cbef4..d5636ebf6 100644 --- a/app/controllers/passwords_controller.rb +++ b/app/controllers/passwords_controller.rb @@ -31,11 +31,12 @@ class PasswordsController < Devise::PasswordsController def set_headers(user) data = user.create_new_auth_token - response.headers[DeviseTokenAuth.headers_names[:"access-token"]] = data['access-token'] - response.headers[DeviseTokenAuth.headers_names[:"token-type"]] = 'Bearer' - response.headers[DeviseTokenAuth.headers_names[:client]] = data['client'] - response.headers[DeviseTokenAuth.headers_names[:expiry]] = data['expiry'] - response.headers[DeviseTokenAuth.headers_names[:uid]] = data['uid'] + headers_names = response.headers[DeviseTokenAuth.headers_names] + headers_names[:'access-token'] = data['access-token'] + headers_names[:'token-type'] = 'Bearer' + headers_names[:'client'] = data['client'] + headers_names[:'expiry'] = data['expiry'] + headers_names[:'uid'] = data['uid'] end def reset_password_and_confirmation(recoverable)