Code-climate duplicate code fixes (#382)

* Code-climate duplicate code fixes

* Spec for accounts controller
This commit is contained in:
Sojan Jose
2019-12-24 17:32:27 +05:30
committed by Pranav Raj S
parent 97ab82892d
commit f98cd83a29
5 changed files with 48 additions and 24 deletions

View File

@@ -0,0 +1,10 @@
module AuthHelper
def send_auth_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']
end
end