omniauth-cgtrader 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile +0 -1
- data/README.md +26 -8
- data/lib/cgtrader/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93139450e38378ddc160a928958213fb43435b4e39aab767e97831a00c3191e9
|
4
|
+
data.tar.gz: 72d863bfe4805bf3ed5f883637fc032843a823cef7104e20b634b20e6cba7399
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d41a08ac2b764c1cbee75ca4a64f86f57e742d08e909ab6ed097c0cfd5a6cdc9cba0bc4a952c901cd39a2029e646e151774c85136da74a7a1cc7eb3eb561d2d
|
7
|
+
data.tar.gz: daeb2bc330ab1911ba81215f2588a82af13cafdb7b6c9307d7d91c5448c7cda6a954a8c160875ad4303ea2c2addfd1db063b6fa74b45b827babc1d78c21e9c80
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -4,21 +4,19 @@ Cgtrader OAuth2 Strategy for OmniAuth.
|
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
|
-
Add
|
7
|
+
Add to your `Gemfile`:
|
8
8
|
|
9
9
|
```ruby
|
10
10
|
gem 'omniauth-cgtrader'
|
11
11
|
```
|
12
12
|
|
13
|
-
|
13
|
+
Then `bundle install`.
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
Or install it yourself as:
|
15
|
+
## Usage
|
18
16
|
|
19
|
-
|
17
|
+
`OmniAuth::Strategies::Cgtrader` is simply a Rack middleware. Read the OmniAuth docs for detailed instructions: https://github.com/intridea/omniauth.
|
20
18
|
|
21
|
-
|
19
|
+
Here's a quick example, adding the middleware to a Rails app in `config/initializers/omniauth.rb`:
|
22
20
|
|
23
21
|
```ruby
|
24
22
|
Rails.application.config.middleware.use OmniAuth::Builder do
|
@@ -26,6 +24,26 @@ Rails.application.config.middleware.use OmniAuth::Builder do
|
|
26
24
|
end
|
27
25
|
```
|
28
26
|
|
29
|
-
## Auth
|
27
|
+
## Auth Hash
|
28
|
+
|
29
|
+
Here's an example *Auth Hash* available in `request.env['omniauth.auth']`:
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
{
|
33
|
+
provider: 'cgtrader',
|
34
|
+
uid: '1234567',
|
35
|
+
info: {
|
36
|
+
id: '123',
|
37
|
+
email: 'joe@bloggs.com',
|
38
|
+
username: 'joe_bloggs',
|
39
|
+
is_admin: false,
|
40
|
+
avatar_url: 'https://upload.wikimedia.org/wikipedia/commons/8/89/Portrait_Placeholder.png'
|
41
|
+
},
|
42
|
+
}
|
43
|
+
```
|
30
44
|
|
31
45
|
## Devise
|
46
|
+
|
47
|
+
See these on how to use this gem with Devise, replacing Google / Facebook with Cgtrader:
|
48
|
+
* https://github.com/zquestz/omniauth-google-oauth2/blob/master/README.md#devise
|
49
|
+
* https://github.com/heartcombo/devise/wiki/OmniAuth:-Overview
|
data/lib/cgtrader/version.rb
CHANGED