ipizza-omniauth-provider 0.1.1 → 0.1.3

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.
data/Gemfile CHANGED
@@ -1,3 +1,3 @@
1
1
  source "http://rubygems.org"
2
2
 
3
- gem 'ipizza', '0.4.0'
3
+ gem 'ipizza', '0.4.2'
data/Rakefile CHANGED
@@ -14,7 +14,7 @@ begin
14
14
  gemspec.email = 'priit@fraktal.ee'
15
15
  gemspec.homepage = 'http://github.com/priithaamer/ipizza-omniauth-provider'
16
16
  gemspec.authors = ['Priit Haamer']
17
- gemspec.add_dependency 'ipizza', '0.4.0'
17
+ gemspec.add_dependency 'ipizza', '0.4.2'
18
18
  end
19
19
  rescue LoadError
20
20
  puts 'Jeweler not available. Install it with: gem install jeweler'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.3
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ipizza-omniauth-provider}
8
- s.version = "0.1.1"
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 = ["Priit Haamer"]
12
- s.date = %q{2010-12-04}
12
+ s.date = %q{2010-12-05}
13
13
  s.description = %q{ Integrates iPizza authentication to your rails app almost effortlessly.
14
14
  }
15
15
  s.email = %q{priit@fraktal.ee}
@@ -37,12 +37,12 @@ Gem::Specification.new do |s|
37
37
  s.specification_version = 3
38
38
 
39
39
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
40
- s.add_runtime_dependency(%q<ipizza>, ["= 0.4.0"])
40
+ s.add_runtime_dependency(%q<ipizza>, ["= 0.4.2"])
41
41
  else
42
- s.add_dependency(%q<ipizza>, ["= 0.4.0"])
42
+ s.add_dependency(%q<ipizza>, ["= 0.4.2"])
43
43
  end
44
44
  else
45
- s.add_dependency(%q<ipizza>, ["= 0.4.0"])
45
+ s.add_dependency(%q<ipizza>, ["= 0.4.2"])
46
46
  end
47
47
  end
48
48
 
@@ -27,6 +27,8 @@ module OmniAuth
27
27
  req = provider.authentication_request
28
28
  url = [req.service_url, Rack::Utils.build_query(req.request_params)] * '?'
29
29
 
30
+ debug "Redirecting to #{url}"
31
+
30
32
  redirect url
31
33
  end
32
34
  end
@@ -42,19 +44,27 @@ module OmniAuth
42
44
 
43
45
  @env['REQUEST_METHOD'] = 'GET'
44
46
 
45
- provider = ipizza_provider_for(request.params['VK_SND_ID'])
46
- resp = provider.authentication_response(request.params)
47
+ # Silly workaround to detect the nordea response
48
+ if request.params['B02K_CUSTID'] then request.params['VK_SND_ID'] = 'nordea' end
47
49
 
48
- if resp.success? and resp.valid?
49
- @user_data = {'personal_code' => resp.info_social_security_id, 'name' => resp.info_name}
50
- @env['omniauth.auth'] = auth_hash
51
-
52
- debug "iPizza request was authenticated successfully. User data: #{auth_hash.inspect}"
53
-
54
- call_app!
50
+ if request.params['VK_SND_ID']
51
+ provider = ipizza_provider_for(request.params['VK_SND_ID'])
52
+ resp = provider.authentication_response(request.params)
53
+
54
+ if resp.valid? and resp.success?
55
+ @user_data = {'personal_code' => resp.info_social_security_id, 'name' => resp.info_name}
56
+ @env['omniauth.auth'] = auth_hash
57
+
58
+ debug "iPizza request was authenticated successfully. User data: #{auth_hash.inspect}"
59
+
60
+ call_app!
61
+ else
62
+ debug 'Could not authenticate iPizza request'
63
+ fail!(:invalid_credentials, {'error' => 'Invalid bank response'})
64
+ end
55
65
  else
56
- debug 'Could not authenticate iPizza request'
57
- fail!(:invalid_credentials, {'error' => 'Invalid bank response'})
66
+ debug 'Did not recognize iPizza request'
67
+ fail(:invalid_credentials, {'error' => 'Bank request cancelled'})
58
68
  end
59
69
  end
60
70
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ipizza-omniauth-provider
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Priit Haamer
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-12-04 00:00:00 +02:00
18
+ date: 2010-12-05 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -26,12 +26,12 @@ dependencies:
26
26
  requirements:
27
27
  - - "="
28
28
  - !ruby/object:Gem::Version
29
- hash: 15
29
+ hash: 11
30
30
  segments:
31
31
  - 0
32
32
  - 4
33
- - 0
34
- version: 0.4.0
33
+ - 2
34
+ version: 0.4.2
35
35
  type: :runtime
36
36
  version_requirements: *id001
37
37
  description: " Integrates iPizza authentication to your rails app almost effortlessly.\n"