model_driven_api 2.3.19 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 83d29c7872f8a719a67efea2d255348bf1d45b59cfed6729a8eba63cd58a3679
|
4
|
+
data.tar.gz: 0d351060548decf558e0d7332ca4c580729070d80ddfd94c7656da1cb45e815f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd8488a506791ee0394b4f148c8df23a47728603cc9e56ed2de894ff74cd8ed3bb701e3077c9ba2c512cb83478373448c7d34552eefd5995f64c1a5fcd43ad40
|
7
|
+
data.tar.gz: 7afcfeb678f4c9d7609468e8e8fad1c5b59a54c41164c2598e201409cd49024be8d6b5f2dea08d1e58778d1905f410f1a826cea278b9b3e251ab850d853690ca
|
@@ -23,7 +23,7 @@ class AuthenticateUser
|
|
23
23
|
# Since this is a new login and I don't care from where it comes, new logins always
|
24
24
|
# Invalidate older tokens
|
25
25
|
UsedToken.where(user_id: api_user.id).update(is_valid: false) if ENV["ALLOW_MULTISESSIONS"] == "false"
|
26
|
-
return result
|
26
|
+
return {jwt: result, user: current_u}
|
27
27
|
end
|
28
28
|
nil
|
29
29
|
end
|
@@ -5,8 +5,9 @@ class Api::V2::AuthenticationController < ActionController::API
|
|
5
5
|
command = !params[:atoken].blank? && User.column_names.include?("access_token") ? AuthenticateUser.call(access_token: params[:atoken]) : AuthenticateUser.call(email: params[:auth][:email], password: params[:auth][:password])
|
6
6
|
|
7
7
|
if command.success?
|
8
|
-
response.headers['Token'] = command.result
|
9
|
-
head :ok
|
8
|
+
response.headers['Token'] = command.result[:jwt]
|
9
|
+
# head :ok
|
10
|
+
render json: command.result[:user].to_json(User.json_attrs), status: 200
|
10
11
|
end
|
11
12
|
end
|
12
13
|
end
|