phcdevworks_accounts_auth0 0.1.0 → 0.2.0
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9d5394d06568e93e4d58ce8834c54b3346d7527d32958bf5bd6b0cbd8d1cf9e
|
4
|
+
data.tar.gz: 6b3eb0b14092e59baa88bfbdc33358674716406c174029ba161570e9153cc787
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 954a93aa11556ee6d635b3621a4ff04fed98e6282866fd751abc44377dde1146b78aecdbf4750415bf6d867509990e6d7f527135ecdf49646edbe9d7de896595
|
7
|
+
data.tar.gz: 21c8748c74c53e65747da0dcef9d92f6f0077e42409cb91d6b9d97f280a40ed45ab788bb8ec8fd22e8871f125e527ce406b7ae4ccf60a7f275896379c49f76cd
|
@@ -4,26 +4,33 @@ module PhcdevworksAccountsAuth0
|
|
4
4
|
def callback
|
5
5
|
auth_info = request.env['omniauth.auth']
|
6
6
|
session[:userinfo] = auth_info['extra']['raw_info']
|
7
|
-
redirect_to '/user
|
7
|
+
redirect_to '/user'
|
8
8
|
end
|
9
9
|
|
10
10
|
def failure
|
11
|
-
# Failed Authentication
|
12
11
|
@error_msg = request.params['message']
|
13
12
|
end
|
14
13
|
|
15
14
|
def logout
|
16
|
-
# Logout
|
17
15
|
reset_session
|
18
16
|
redirect_to logout_url
|
19
17
|
end
|
20
18
|
|
19
|
+
private
|
20
|
+
|
21
|
+
AUTH0_CONFIG = Rails.application.config_for(:auth0)
|
22
|
+
|
21
23
|
def logout_url
|
22
24
|
request_params = {
|
23
25
|
returnTo: root_url,
|
24
26
|
client_id: AUTH0_CONFIG['auth0_client_id']
|
25
27
|
}
|
26
|
-
|
28
|
+
|
29
|
+
URI::HTTPS.build(host: AUTH0_CONFIG['auth0_domain'], path: '/v2/logout', query: to_query(request_params)).to_s
|
30
|
+
end
|
31
|
+
|
32
|
+
def to_query(hash)
|
33
|
+
hash.map { |k, v| "#{k}=#{CGI.escape(v)}" unless v.nil? }.reject(&:nil?).join('&')
|
27
34
|
end
|
28
35
|
|
29
36
|
end
|
data/config/routes.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phcdevworks_accounts_auth0
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PHCDevworks
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-09-
|
12
|
+
date: 2022-09-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|