capcoauth 0.6.3 → 0.7.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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ccb50d6f80819e2df683c0e6a4fa2a804f07dfb2efbcd4e243e4676fc623a34c
|
4
|
+
data.tar.gz: 657b59b5775e7e564a1f9a8d66c581d4e7861479d35a053b5c177d4c7a2dd5f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7b8b2cfb9c5ce59c62d6df7be497bc9f2df438cc92b38fd8a2c3af36a7f931dc142a5ed8e9ae853d86fef11b64eb2a3920a5b6b3778a36333dfae466d9bda76
|
7
|
+
data.tar.gz: acab18d6e4f65d747f70660d98f3f0c976fb196f445ebd1fc3d02520c740c987a5319b5dfda6c24826cda11e754980195f4bf89fd5c7ff118413ef07f909e992
|
@@ -14,5 +14,15 @@ module Capcoauth
|
|
14
14
|
def oauth_callback_url
|
15
15
|
"#{root_url}auth/callback"
|
16
16
|
end
|
17
|
+
|
18
|
+
protected
|
19
|
+
|
20
|
+
def rotate_session_id
|
21
|
+
session_data = session.to_h
|
22
|
+
reset_session
|
23
|
+
session_data.each do |k, v|
|
24
|
+
session[k] = v
|
25
|
+
end
|
26
|
+
end
|
17
27
|
end
|
18
28
|
end
|
@@ -23,6 +23,7 @@ module Capcoauth
|
|
23
23
|
@access_token = OAuth::AccessToken.new(response.parsed_response['access_token']).verify
|
24
24
|
|
25
25
|
if @access_token
|
26
|
+
rotate_session_id
|
26
27
|
session[:capcoauth_access_token] = @access_token.token
|
27
28
|
session[:capcoauth_user_id] = @access_token.user_id
|
28
29
|
redirect_to session[:previous_url].blank? ? root_url : session.delete(:previous_url)
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module Capcoauth
|
2
2
|
class LogoutController < Capcoauth::ApplicationController
|
3
3
|
def show
|
4
|
-
session
|
5
|
-
|
4
|
+
token = session[:capcoauth_access_token]
|
5
|
+
session.destroy
|
6
6
|
OAuth::TTLCache.remove(token) if token.present?
|
7
7
|
redirect_to root_url, notice: 'You have been logged out'
|
8
8
|
end
|
data/lib/capcoauth/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capcoauth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Robertson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-06-
|
11
|
+
date: 2021-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|