lockie 0.2.7 → 0.2.8

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: efb72bf28aeb5ffd56d09a525ffca512da79bab6265e629ec11cc6b74bd8aa94
4
- data.tar.gz: bf5e8d28caec5bc991c958cccff7fab3750b09ebe6c43b843647af33bfee7673
3
+ metadata.gz: 06027d091324bf7822e326a262e35cbd94d170658d9f142e02fbb53df314f6c6
4
+ data.tar.gz: 9a47a99c1a91ac49c39babdad32136c2f01bd2d1952b66ba0cb055e357f9ecc9
5
5
  SHA512:
6
- metadata.gz: 4beed6d81b8f153ba3fc5a5fa6638fe57d4ca3aece74cfa319267f3dae2fba56646a74a988969bf77d61b6e42ebe49aa56bd27508bc9748a4b0a7cc38a3ffdfc
7
- data.tar.gz: 6975178392cc3413f84ab773f981c3b9261c245fb5df14760c47ee7373891a5a7ac03951bb2e0b384dadaaf138cba0f90b2440ac220afa45f554038c67491abe
6
+ metadata.gz: 2f50baf7c9418de8284ad4719ce98607acd00f50487cc11ee842dddf31fdac9c329b6b4bb692c93afe81a3c7b6f5eaee5e417b1ca24db6e1ea9e9d5ca9c9d95d
7
+ data.tar.gz: d361cdea1d3d3d19688c33e0e62843124fe25d6f877ec1781c5c84ee5b1d7bc606bc7b67820e3b6b12a3309193d4de623a2d71c2a7ea548dd55f9a4832bfb5f4
data/README.md CHANGED
@@ -9,7 +9,7 @@ A drop-in, none assuming warden based Password and JWT authentication for Rails
9
9
  Add this line to your application's Gemfile:
10
10
 
11
11
  ```ruby
12
- gem 'lockie', '~> 0.2.6'
12
+ gem 'lockie', '~> 0.2.7'
13
13
  ```
14
14
 
15
15
  And then execute:
@@ -81,6 +81,16 @@ Lockie.configure do |c|
81
81
 
82
82
  # add custom warden strategy, default strategies and priority are [:email_password, :jwt]
83
83
  c.default_strategies = [:auth0, :jwt]
84
+
85
+ # set custom session serializer
86
+ c.serializer_to_session = proc {|u| u.id }
87
+ c.serializer_from_session = proc {|id| User.find(id) }
88
+
89
+ # set custom scopes
90
+ c.scopes = [
91
+ [:api, { store: false, strategies: [:jwt]}],
92
+ [:web, { store: true, strategies: [:email_password]}]
93
+ ]
84
94
  end
85
95
  ```
86
96
 
@@ -3,8 +3,9 @@ module Lockie
3
3
  extend ActiveSupport::Concern
4
4
 
5
5
  included do
6
+
6
7
  if respond_to?(:helper_method)
7
- helper_method "current_#{ Lockie.config.model_name.underscore }".to_sym
8
+ helper_method "current_#{ Lockie.config.model_name.underscore.gsub(/\//, '_') }".to_sym
8
9
  helper_method :logged_in?
9
10
  helper_method :authenticated?
10
11
  end
@@ -14,7 +15,7 @@ module Lockie
14
15
  env['warden']
15
16
  end
16
17
 
17
- define_method "current_#{ Lockie.config.model_name.underscore }".to_sym do |*args|
18
+ define_method "current_#{ Lockie.config.model_name.underscore.gsub(/\//, '_') }".to_sym do |*args|
18
19
  warden.user(*args)
19
20
  end
20
21
 
@@ -1,3 +1,3 @@
1
1
  module Lockie
2
- VERSION = '0.2.7'
2
+ VERSION = '0.2.8'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lockie
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Melvin Sembrano
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-03 00:00:00.000000000 Z
11
+ date: 2019-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -135,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
135
  - !ruby/object:Gem::Version
136
136
  version: '0'
137
137
  requirements: []
138
- rubygems_version: 3.0.3
138
+ rubygems_version: 3.0.4
139
139
  signing_key:
140
140
  specification_version: 4
141
141
  summary: Drop in password and JWT token authentication for Ruby on Rails