omniauth-your-membership-token 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -0
- data/lib/omniauth/strategies/your_membership_token.rb +13 -10
- data/lib/omniauth/your_membership_token/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3e72458def061151d23a7bc5c8f70a944fce061
|
4
|
+
data.tar.gz: ba57375bb44a13a4be124a369118f33689e32e9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 360b7f3f30aa07ed16286d6a080a21fac074d4c1a7b456a04079fcee63298ead7802abb6297eb1df524e1fc6e3b24b370d6fbc9464ed9210aebd9b6cdc4c59a2
|
7
|
+
data.tar.gz: d66609aa1877c9c54c1f57a93b54c32e4ae9da204b8e7529c1ad592440ee4b5c8aff1541ad5accfc39825b685e751f5072beb5bf3fc84ed2301de853e55510b5
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# Change Log
|
2
|
+
All notable changes to this project will be documented in this file.
|
3
|
+
This project adheres to [Semantic Versioning](http://semver.org/).
|
4
|
+
|
5
|
+
## [Unreleased]
|
6
|
+
|
7
|
+
## [1.1.2]
|
8
|
+
### Changed
|
9
|
+
- In request phase, convert `SocketError` into an OmniAuth failure.
|
10
|
+
This allows for easier handling in application code.
|
11
|
+
|
12
|
+
## [1.1.1] - 2017-02-16
|
13
|
+
### Breaking
|
14
|
+
- Require omniauth 1.3.2+ or 1.4+ (for compatibility with
|
15
|
+
https://github.com/omniauth/omniauth/commit/71866c5264122e196847a3980c43051446a03e9b)
|
@@ -17,15 +17,18 @@ module OmniAuth
|
|
17
17
|
# the name of the class. This returns an uncapitalized url which Rails will not recognize as the same path as the
|
18
18
|
# devise controller. This is a forced way to do this and probably has a more elegant solution.
|
19
19
|
options.name = 'yourMembershipToken'
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
20
|
+
|
21
|
+
begin
|
22
|
+
# Build an Access Token
|
23
|
+
session = YourMembership::Session.create
|
24
|
+
token_hash = session.createToken(:RetUrl => callback_url)
|
25
|
+
# Pass the YourMembership session id to the Callback
|
26
|
+
request.GET['ym_session'] = session.to_s
|
27
|
+
# Redirect to token url
|
28
|
+
redirect token_hash['GoToUrl']
|
29
|
+
rescue SocketError => e
|
30
|
+
fail! e.message
|
31
|
+
end
|
29
32
|
end
|
30
33
|
|
31
34
|
def callback_phase
|
@@ -33,7 +36,7 @@ module OmniAuth
|
|
33
36
|
|
34
37
|
ym_session_id = request.env['omniauth.params']['ym_session']
|
35
38
|
|
36
|
-
ym_session
|
39
|
+
ym_session = YourMembership::Session.new(ym_session_id, 100)
|
37
40
|
|
38
41
|
begin
|
39
42
|
fail! 'Failed To Log In' unless ym_session.authenticated?
|
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.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nate Flood
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth
|
@@ -81,6 +81,7 @@ extensions: []
|
|
81
81
|
extra_rdoc_files: []
|
82
82
|
files:
|
83
83
|
- ".gitignore"
|
84
|
+
- CHANGELOG.md
|
84
85
|
- Gemfile
|
85
86
|
- LICENSE.txt
|
86
87
|
- README.md
|