sso_clyent 0.0.7 → 0.0.7.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MzEwYWFhODI1NjQ0MDA4Y2VhMTBkOTI1OWFlZGNiZjE3MGJkYmNhNQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZGNhZmRjMGQ0MTRhZTk0MjdhOTYwNjIzNTNhOTM0Njg3MzkwNmIyZA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OGI1Mjc3NzkxNmExMDdjZmRiMWRjNDFjYmIwYjkyN2RmNzhjZDNkODI1NmNk
|
10
|
+
Zjk0ZGU2YWZhNDYwN2ZmYzk0NGVkM2MxZGZlMjZmNDE1MDkxZGJjNzNmMGI0
|
11
|
+
Njg2NzJhYWEwOWE1MjBmYjk1ODRjYjRiYzRiMzhmYzAyMjJiMDI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODM3YTcwZTg0NTZkYWU5MjM5YTRmNDZjY2Y1NzA5OTQ3NDg2MTFlZmJlYWYz
|
14
|
+
YzE5NGM0NzE4ZjMwYjAxY2U5Y2I0NTg1NjJjOTIwN2YzYzQzZTc5MzQ1ZjQ4
|
15
|
+
NWVlNGUyNzIwZjNlY2ZjMTM3ZmIyNjc0OWRlNWZhYmQ3ZmE1NDk=
|
@@ -31,7 +31,7 @@ class SsoClyent::UserSessionsController < SsoClyent::ApplicationController
|
|
31
31
|
# logout - Clear our rack session BUT essentially redirect to the provider
|
32
32
|
# to clean up the Devise session from there too !
|
33
33
|
def destroy
|
34
|
-
|
34
|
+
current_user_logout
|
35
35
|
|
36
36
|
flash[:notice] = 'You have successfully signed out!'
|
37
37
|
redirect_to "#{OmniAuth::Strategies::Sso._provider[:url]}/logout?callback_url=#{root_url}"
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module CurrentUserHelpers
|
2
2
|
def login_required
|
3
3
|
if !current_user
|
4
|
-
respond_to do |format|
|
4
|
+
return respond_to do |format|
|
5
5
|
format.html { redirect_to "#{SsoClyent.path}/auth/sso" }
|
6
6
|
format.json { render :json => { 'error' => 'Access Denied' }.to_json }
|
7
7
|
end
|
@@ -16,6 +16,14 @@ module CurrentUserHelpers
|
|
16
16
|
@current_user ||= users.send(:"find_by_#{uid}", session[:user_id]['uid'])
|
17
17
|
end
|
18
18
|
end
|
19
|
+
|
20
|
+
def check_for_login_error api_response
|
21
|
+
current_user_logout if !api_response.is_a? Array and api_response.try(:[],:error).try(:==,'401 Unauthorized')
|
22
|
+
end
|
23
|
+
|
24
|
+
def current_user_logout
|
25
|
+
session[:user_id] = nil
|
26
|
+
end
|
19
27
|
|
20
28
|
def user_klass
|
21
29
|
SsoClyent.user_class
|
data/lib/sso_clyent/engine.rb
CHANGED
@@ -8,7 +8,10 @@ module SsoClyent
|
|
8
8
|
|
9
9
|
config.sso_clyent = ActiveSupport::OrderedOptions.new
|
10
10
|
|
11
|
-
initializer "sso_client.configure" do |app|
|
11
|
+
initializer "sso_client.configure" do |app|
|
12
|
+
puts app.config.sso_clyent
|
13
|
+
puts app.config.sso_clyent.try(:keys)
|
14
|
+
puts app.config.sso_clyent.try(:keys).try(:include?, :setup_omniauth)
|
12
15
|
should_load_sso_clyent = app.config.sso_clyent.try(:keys).try(:include?, :setup_omniauth) ? app.config.sso_clyent[:setup_omniauth] : true
|
13
16
|
if should_load_sso_clyent
|
14
17
|
SsoClyent.configure(app.config.sso_clyent)
|
data/lib/sso_clyent/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sso_clyent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.7
|
4
|
+
version: 0.0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- NicoArbogast
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|