easy_login 1.0.2 → 1.0.3

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: 4d6eea9cc2dc1a5193d6ce838887f4053e81ac9c
4
- data.tar.gz: b488c349846165f73744d77d4c75237bb77d7b1f
3
+ metadata.gz: bd2b5799e90f0746d45eda813f79e6c7f40aad0d
4
+ data.tar.gz: af8feb14d87000766c6932743323c8f3532fa303
5
5
  SHA512:
6
- metadata.gz: e7a84eff82c7e1b513a0ab3aeecc2c2ecc9bcd538dfd6f65b1b3d8c19350cad006b93a1e474ca98cd603bb5682b16416f05c5e746ec5ccb063625e3bfe147c5e
7
- data.tar.gz: d7a5f857fbd98626da6d98474d9a058e0e251144e66c3613f4f4b4b9d0ee89d806c9f529a0d2fc3dac595df876518255e83f53300b85924c07431adc46bc319f
6
+ metadata.gz: 5deb09ad7d7bfec4f6b27fc9db6fbff3d2c3e545a470a92159247aa58c991291355876a3e60dd61c8fa242987cce0aefc77c4355c3737a6acc1db9f87f51a3cc
7
+ data.tar.gz: a8cc6ced54dc7929142ef8225e6c6485ae655de2ea1e1c883b944baefa5a62600c67b79a4838c0351c0047bd9482131724d50a6f6ff78cada858f2080cc0fce9
data/README.md CHANGED
@@ -39,6 +39,16 @@ Added following code to `application_controller.rb`
39
39
  include EasyLogin
40
40
  ```
41
41
 
42
+ ※ *updated at 2017-03-21* for ActionCable::Connection in Rails 5, write code like below. `include EasyLogin` will be error.
43
+
44
+ ```ruby
45
+ module ApplicationCable
46
+ class Connection < ActionCable::Connection::Base
47
+ include EasyLogin::Session
48
+ end
49
+ end
50
+ ```
51
+
42
52
  And then abosultely use all methods above in controller and view
43
53
 
44
54
  Also you can declare a redirect schema for differenct user accessing differect
@@ -15,6 +15,7 @@ module EasyLogin
15
15
  if url
16
16
  raise ActionController::RoutingError.new("Routing Error") if url == 404
17
17
  url = controller_ins.send url if url.end_with? "path"
18
+ return if url == "nil"
18
19
  controller_ins.redirect_to url
19
20
  end
20
21
  end
@@ -1,3 +1,3 @@
1
1
  module EasyLogin
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
data/lib/easy_login.rb CHANGED
@@ -20,12 +20,20 @@ module EasyLogin
20
20
  end
21
21
  end
22
22
 
23
- def self.included(base)
24
- base.send :include, Session
25
- base.helper_method EasyLogin.helper_method
26
- base.send :before_action do |controller|
27
- Redirect.parse controller
28
- end
29
- end
23
+ def self.included(base)
24
+ base.send :include, Session
25
+ if base == ApplicationController
26
+ base.helper_method EasyLogin.helper_method
27
+ base.send :before_action do |controller|
28
+ Redirect.parse controller
29
+ end
30
+ elsif base == ApplicationCable::Connection
31
+ base.send :identified_by, :client
32
+ end
33
+ end
34
+
35
+ def self.cable_authorize(connection, current_user)
36
+ connection.client = current_user
37
+ end
30
38
 
31
39
  end
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_login
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - goshan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-04 00:00:00.000000000 Z
11
+ date: 2017-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -64,6 +64,7 @@ files:
64
64
  - pkg/easy_login-0.1.3.gem
65
65
  - pkg/easy_login-1.0.0.gem
66
66
  - pkg/easy_login-1.0.1.gem
67
+ - pkg/easy_login-1.0.2.gem
67
68
  homepage: https://github.com/goshan/easy_login
68
69
  licenses:
69
70
  - MIT