rails_jwt_auth 0.11.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 384764905f675b597bd75bdf93effeebaf2a7db9
|
4
|
+
data.tar.gz: 2a2102b4130c4a47d47a3636317ca178ffd6fc1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83aedab8d589999c15a5388e7e04b1e07dffc24237a9cda2e5bb25dea8b5433db39771467c5193e0be27b623eaa4cd150c5b34fdfb34c01ec439bdd256b43a25
|
7
|
+
data.tar.gz: ae569c11ed9b815db125a38ac8167f308d86d9892981e02f267a717ad7ca932491eb6c00f71cbf5b0738158f31a25e10c727696836ce1572542e7f08d3a9ffcc
|
@@ -2,21 +2,15 @@ module RailsJwtAuth
|
|
2
2
|
module Spec
|
3
3
|
module Helpers
|
4
4
|
require 'rails_jwt_auth/spec/not_authorized'
|
5
|
-
require 'rails_jwt_auth/jwt/manager'
|
6
5
|
|
7
6
|
def sign_out
|
8
|
-
|
9
|
-
allow(request.env['warden']).to receive(:authenticate!).and_raise(RailsJwtAuth::Spec::NotAuthorized)
|
7
|
+
allow(controller).to receive(:authenticate!).and_raise(RailsJwtAuth::Spec::NotAuthorized)
|
10
8
|
end
|
11
9
|
|
12
10
|
def sign_in(user)
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
user.auth_tokens = []
|
18
|
-
token = user.regenerate_auth_token
|
19
|
-
request.env['HTTP_AUTHORIZATION'] = RailsJwtAuth::Jwt::Manager.encode(auth_token: token)
|
11
|
+
manager = Warden::Manager.new(nil, &Rails.application.config.middleware.detect{|m| m.name == 'Warden::Manager'}.block)
|
12
|
+
request.env['warden'] = Warden::Proxy.new(request.env, manager)
|
13
|
+
request.env['warden'].set_user(user, store: false)
|
20
14
|
end
|
21
15
|
end
|
22
16
|
end
|
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.12.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-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|