gatekeeper 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{gatekeeper}
8
- s.version = "0.1.2"
8
+ s.version = "0.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Chris Dinn"]
12
- s.date = %q{2010-01-14}
12
+ s.date = %q{2010-01-16}
13
13
  s.description = %q{Connects any Rack-compatible app to a Hot Ink single sign on server.}
14
14
  s.email = %q{chrisgdinn@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -1,10 +1,10 @@
1
1
  module Gatekeeper
2
2
  module Helpers
3
3
  module Authentication
4
- def current_user
5
- session[:sso] && session[:sso][:user_id]
4
+ def current_user?
5
+ session[:sso] && !session[:sso][:user_id].nil?
6
6
  end
7
-
7
+
8
8
  def is_admin?
9
9
  (session[:sso][:is_admin?]=='true')
10
10
  end
@@ -22,7 +22,7 @@ module Gatekeeper
22
22
  return_url = URI.parse(session['sso_return_to'])
23
23
 
24
24
  unless return_url.host==request.host
25
- user_token = UserToken.create!(:user_id => sso_user_id)
25
+ user_token = UserToken.create!(:user_id => sso_user_id, :email => sso_user_email)
26
26
  if return_url.query==nil
27
27
  return_url.query = "user_token=#{user_token.token}"
28
28
  else
@@ -53,7 +53,7 @@ describe "Gatekeeper" do
53
53
  get '/sso/login', {}, 'rack.openid.response' => checkid_response
54
54
 
55
55
  last_response.should be_redirect
56
- last_response.headers['Location'].should == "/"
56
+ last_response.headers['Location'].should == "/"
57
57
  end
58
58
 
59
59
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gatekeeper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Dinn
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-14 00:00:00 -05:00
12
+ date: 2010-01-16 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency