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: eb1e415a9ec09f06237ed0aa2a020044cc72c8ea
4
- data.tar.gz: e8772b6b9e8e711d4803ee63ce3fdaf21e6b374b
3
+ metadata.gz: 384764905f675b597bd75bdf93effeebaf2a7db9
4
+ data.tar.gz: 2a2102b4130c4a47d47a3636317ca178ffd6fc1b
5
5
  SHA512:
6
- metadata.gz: 232806debf45ed172ff4db611bb25ce530f5c0312e51de21c4995af25133963bd1045f4078ebf1c646872e5e151ed9b6092d32ab07647abc6641f13ef129f39e
7
- data.tar.gz: 50cca6d19567f8c2ceb2c80b338fd9ee3a34edb20c237378f52e955c66620de6e9371f9a0bea73b2c8b48d24ead03a2ca4f042df0ca6127cb2a382c38f7c0431
6
+ metadata.gz: 83aedab8d589999c15a5388e7e04b1e07dffc24237a9cda2e5bb25dea8b5433db39771467c5193e0be27b623eaa4cd150c5b34fdfb34c01ec439bdd256b43a25
7
+ data.tar.gz: ae569c11ed9b815db125a38ac8167f308d86d9892981e02f267a717ad7ca932491eb6c00f71cbf5b0738158f31a25e10c727696836ce1572542e7f08d3a9ffcc
@@ -13,7 +13,7 @@ module RailsJwtAuth
13
13
  end
14
14
 
15
15
  def authenticate!
16
- warden.authenticate!
16
+ warden.authenticate!(store: false)
17
17
  end
18
18
 
19
19
  def self.included(base)
@@ -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
- request.env['warden'] = RailsJwtAuth::Strategies::Jwt.new request.env
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
- request.env['warden'] = RailsJwtAuth::Strategies::Jwt.new request.env
14
- allow(request.env['warden']).to receive(:authenticate!).and_return(user)
15
- allow(controller).to receive(:current_user).and_return(user)
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
@@ -1,3 +1,3 @@
1
1
  module RailsJwtAuth
2
- VERSION = '0.11.0'
2
+ VERSION = '0.12.0'
3
3
  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.11.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-30 00:00:00.000000000 Z
11
+ date: 2017-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails