omniauth-your-membership-token 1.0.0 → 1.1.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
  SHA1:
3
- metadata.gz: 9b6cbc53f84e9388a1eb6d143ff170395d8b401f
4
- data.tar.gz: 7977fd59d21e5b80125aeee25a73ab4acd50d791
3
+ metadata.gz: ceb5ca53fc401ebfe612da6cc813d343649a2f4f
4
+ data.tar.gz: 6c62cc0bf2a8e8a884a3e28fb41405cd571581f7
5
5
  SHA512:
6
- metadata.gz: 3e456fe9bc3be2ff2d5bda42d621deb16c0ecb14d434c3e6ae5ee1060a7df0119f4522843681e92d4c31e9fd065407de8b0dcc414027a7f42830710312d52f7c
7
- data.tar.gz: 87ec483b50b9a011a2042c4efc10cd14ba43980d7e29ac5a1fd5722db3797a6e95a93187b7f395b6a0bcc040cb8fc07c560db1ef373cc3c3aaa93e0f9d700e55
6
+ metadata.gz: a5abdfa44b26fd2fb028d5666bfdac35255ef3c89add3f1b9d222ccf749b919b36b47f8790359bd6f1005b10754f82970eef116d5d927b9fbb3c9274a1bd03dc
7
+ data.tar.gz: ef8473216754dff0bb47ada7103740da7c6f1b2836126161cd39424d1ccba00f8888d77ec740d13fa448ca6d270bcc18ce606d3aa81758a85f1bad84871184b5
@@ -12,21 +12,28 @@ module OmniAuth
12
12
  option :uid_field, :member_id
13
13
 
14
14
  def request_phase
15
+
16
+ # We're doing this because the callback_url is built from the options.name attribute which is built by downcasing
17
+ # the name of the class. This returns an uncapitalized url which Rails will not recognize as the same path as the
18
+ # devise controller. This is a forced way to do this and probably has a more elegant solution.
19
+ options.name = 'yourMembershipToken'
15
20
  # Build an Access Token
16
21
  session = YourMembership::Session.create
22
+ #binding.pry
17
23
  token_hash = session.createToken(:RetUrl => callback_url)
18
24
 
19
25
  # Pass the YourMembership session id to the Callback
20
- request.params[:ym_session] = session.to_s
21
-
26
+ request.params['ym_session'] = session.to_s
22
27
  # Redirect to token url
23
28
  redirect token_hash['GoToUrl']
24
29
  end
25
30
 
26
31
  def callback_phase
27
32
  # create session object
33
+
34
+ ym_session_id = request.env['omniauth.params']['ym_session']
28
35
 
29
- ym_session = YourMembership::Session.new(request.env['omniauth.params'][:ym_session], 100)
36
+ ym_session = YourMembership::Session.new(ym_session_id, 100)
30
37
 
31
38
  fail! 'Failed To Log In' unless ym_session
32
39
  begin
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module YourMembershipToken
3
- VERSION = "1.0.0"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-your-membership-token
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nate Flood
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-22 00:00:00.000000000 Z
11
+ date: 2014-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth