rails_jwt_auth 0.9.0 → 0.10.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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 808b8e1b69bc9436608046e8f55038edeb682471
|
4
|
+
data.tar.gz: fdeb6c11cb065a111e93745fa58340c66ba87c2d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e29a0701f454f1ea0d7b3eac33475c2c5451649676014c11ab37111aec834d62071f856716a01dde03b6dfa0129a5151a16f7f27e97695a9ab5d4292abc9bae5
|
7
|
+
data.tar.gz: 0cc896578dc215894bc5cec3a2333a47452d16a4034ccc365d9d0e56fde105ccd0bd1fffbfaf227929ace52b7cf8190b54954c4b980a85048ff7e7500045c03c
|
@@ -1,6 +1,11 @@
|
|
1
1
|
module RailsJwtAuth
|
2
2
|
module RenderHelper
|
3
|
-
def
|
3
|
+
def render_session(jwt, user)
|
4
|
+
auth_field = RailsJwtAuth.auth_field_name
|
5
|
+
render json: {session: {jwt: jwt, auth_field => user[auth_field]}}, status: 201
|
6
|
+
end
|
7
|
+
|
8
|
+
def render_registration(resource)
|
4
9
|
render json: resource, root: true, status: 201
|
5
10
|
end
|
6
11
|
|
@@ -15,7 +15,7 @@ module RailsJwtAuth
|
|
15
15
|
elsif user.respond_to?('confirmed?') && !user.confirmed?
|
16
16
|
render_422 session: [I18n.t('rails_jwt_auth.errors.unconfirmed')]
|
17
17
|
elsif user.authenticate(session_create_params[:password])
|
18
|
-
|
18
|
+
render_session get_jwt(user), user
|
19
19
|
else
|
20
20
|
render_422 session: [create_session_error]
|
21
21
|
end
|
@@ -24,6 +24,7 @@ module RailsJwtAuth
|
|
24
24
|
def destroy
|
25
25
|
authenticate!
|
26
26
|
current_user.destroy_auth_token Jwt::Request.new(request).auth_token
|
27
|
+
render_204
|
27
28
|
end
|
28
29
|
|
29
30
|
private
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_jwt_auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rjurado
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|