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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ceb5ca53fc401ebfe612da6cc813d343649a2f4f
|
4
|
+
data.tar.gz: 6c62cc0bf2a8e8a884a3e28fb41405cd571581f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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[
|
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(
|
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
|
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.
|
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-
|
11
|
+
date: 2014-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth
|