tinytokenauth-rails 0.1.8 → 0.1.10

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
  SHA256:
3
- metadata.gz: 16db7cdd60c7295a08eb0ca07fbcc229289cff1a0f867d5147c98fd1c10929e7
4
- data.tar.gz: 483600dc44ab04a814b04f21ef9cf0fe24b09908327d46c6a29b12a5f480bc78
3
+ metadata.gz: ae295a501e67fee2e98e508ea9636b94f3017475742de2b6b2461fdbbe17f389
4
+ data.tar.gz: d19ddced80b62167e43c170eb4fc26120696ea96988f5837fed750f0efa6e10c
5
5
  SHA512:
6
- metadata.gz: 482c5de56d33c9135b2ee74b1a7fa0bc1d5aa43386d9a6ef6dc30acfaed128ad3ef4dc6274e17f6dda82a8370f22bca64566da6d8f62efb3c91c94003695c8d8
7
- data.tar.gz: a7e8813692d44a322b74e37b5562f5e6a9228d1a82b2ec724cef16004615b29856e385029a9d3c7ba05614b71fb0a51b9e1939825a7807aa6ac59b56b3875715
6
+ metadata.gz: b75608e2ecc22a9989498ce11d2203188cc9d24a220ead721326c18899036d0cb240dd5a08efdcff3bf40fa5b27a1b5822fd257272e39559f6f1dcce29db910b
7
+ data.tar.gz: 19348987f715a8a75580d010368183a0e675ea5bec6567ecf616b876810bbc837f4741d1fd185d2684bb23f00bf275a289c2539c33dc6b15c15cf14d8acfc6d4
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tinytokenauth-rails (0.1.7)
4
+ tinytokenauth-rails (0.1.9)
5
5
  jwt (~> 2.7)
6
6
  rails (>= 6.0)
7
7
 
@@ -20,7 +20,8 @@ module Tinytokenauth
20
20
 
21
21
  begin
22
22
  @decoded = JsonWebToken.decode(Tinytokenauth.configuration.token_secret, token)
23
- @current_user = Tinytokenauth.configuration.user_class.send 'find', @decoded[:user_id]
23
+ # @current_user = Tinytokenauth.configuration.user_class.send 'find', @decoded[:user_id]
24
+ @current_user = User.find @decoded[:user_id]
24
25
  rescue ActiveRecord::RecordNotFound => e
25
26
  render json: { errors: e.message }, status: :unauthorized
26
27
  rescue JWT::DecodeError => e
@@ -32,7 +33,7 @@ module Tinytokenauth
32
33
  token = cookies[Tinytokenauth.configuration.cookie_name]
33
34
  begin
34
35
  @decoded = JsonWebToken.decode(Tinytokenauth.configuration.token_secret, token)
35
- @current_user = Tinytokenauth.configuration.user_class.send 'find', @decoded[:user_id]
36
+ @current_user = User.find @decoded[:user_id]
36
37
  @exp = @decoded[:exp]
37
38
  if Tinytokenauth.configuration.token_auto_renew_hours &&
38
39
  @exp < Tinytokenauth.configuration.token_auto_renew_hours.hours.from_now.to_i
@@ -4,7 +4,7 @@ module Tinytokenauth
4
4
  attr_accessor :user_class, :token_validity_hours, :token_auto_renew_hours, :token_secret, :cookie_name
5
5
 
6
6
  def initialize
7
- @user_class = User
7
+ # @user_class = User
8
8
  @token_validity_hours = 24
9
9
  @token_auto_renew_hours = 4
10
10
  @token_secret = Rails.application.credentials.secret_key_base
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tinytokenauth
4
- VERSION = "0.1.8"
4
+ VERSION = "0.1.10"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tinytokenauth-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kim Laplume