2019-12-24 12:02:27 +00:00
|
|
|
module AuthHelper
|
|
|
|
def send_auth_headers(user)
|
|
|
|
data = user.create_new_auth_token
|
2021-08-03 14:41:52 +00:00
|
|
|
response.headers[DeviseTokenAuth.headers_names[:'access-token']] = data['access-token']
|
|
|
|
response.headers[DeviseTokenAuth.headers_names[:'token-type']] = 'Bearer'
|
2019-12-24 12:02:27 +00:00
|
|
|
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
|