omniauth-social 0.2.4 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- metadata +3 -31
- data/.gitignore +0 -8
- data/CODE_OF_CONDUCT.md +0 -74
- data/Gemfile +0 -7
- data/Gemfile.lock +0 -153
- data/LICENSE.txt +0 -21
- data/README.md +0 -43
- data/Rakefile +0 -2
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/lib/omniauth/social/callbacks.rb +0 -24
- data/lib/omniauth/social/service.rb +0 -63
- data/lib/omniauth/social/version.rb +0 -5
- data/lib/omniauth/social.rb +0 -15
- data/lib/omniauth/strategies/line.rb +0 -38
- data/omniauth-social-0.1.0.gem +0 -0
- data/omniauth-social-0.1.1.gem +0 -0
- data/omniauth-social-0.1.2.gem +0 -0
- data/omniauth-social-0.1.3.gem +0 -0
- data/omniauth-social-0.1.4.gem +0 -0
- data/omniauth-social-0.1.5.gem +0 -0
- data/omniauth-social-0.1.6.gem +0 -0
- data/omniauth-social-0.1.7.gem +0 -0
- data/omniauth-social-0.1.8.gem +0 -0
- data/omniauth-social-0.1.9.gem +0 -0
- data/omniauth-social-0.2.1.gem +0 -0
- data/omniauth-social-0.2.2.gem +0 -0
- data/omniauth-social-0.2.3.gem +0 -0
- data/omniauth-social.gemspec +0 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56ae67d4df0540a9737183f27bffae68f8b29e11
|
4
|
+
data.tar.gz: 6fa7b0b632746d7f685b118b07ecd1e135cba940
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50982954c6a82e7c45da0a42967cb9aeecd056d8051114c088f90e27ee71a59510bb90213edd5f18502ced7a29c72c2b98aba6e4ed6a34e8e0b5a978dcb20751
|
7
|
+
data.tar.gz: e64547cf1fd08639b535b8ec45a5b92c8d4f4f8582478885ec716a7a3eb1287e068da45daaea6ca3dcc383e658e7fe27d4f4430051dbc58d9f1bf24ac0db1e27
|
metadata
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-social
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nguyenthanhcong101096
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2019-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
@@ -64,35 +64,7 @@ email:
|
|
64
64
|
executables: []
|
65
65
|
extensions: []
|
66
66
|
extra_rdoc_files: []
|
67
|
-
files:
|
68
|
-
- ".gitignore"
|
69
|
-
- CODE_OF_CONDUCT.md
|
70
|
-
- Gemfile
|
71
|
-
- Gemfile.lock
|
72
|
-
- LICENSE.txt
|
73
|
-
- README.md
|
74
|
-
- Rakefile
|
75
|
-
- bin/console
|
76
|
-
- bin/setup
|
77
|
-
- lib/omniauth/social.rb
|
78
|
-
- lib/omniauth/social/callbacks.rb
|
79
|
-
- lib/omniauth/social/service.rb
|
80
|
-
- lib/omniauth/social/version.rb
|
81
|
-
- lib/omniauth/strategies/line.rb
|
82
|
-
- omniauth-social-0.1.0.gem
|
83
|
-
- omniauth-social-0.1.1.gem
|
84
|
-
- omniauth-social-0.1.2.gem
|
85
|
-
- omniauth-social-0.1.3.gem
|
86
|
-
- omniauth-social-0.1.4.gem
|
87
|
-
- omniauth-social-0.1.5.gem
|
88
|
-
- omniauth-social-0.1.6.gem
|
89
|
-
- omniauth-social-0.1.7.gem
|
90
|
-
- omniauth-social-0.1.8.gem
|
91
|
-
- omniauth-social-0.1.9.gem
|
92
|
-
- omniauth-social-0.2.1.gem
|
93
|
-
- omniauth-social-0.2.2.gem
|
94
|
-
- omniauth-social-0.2.3.gem
|
95
|
-
- omniauth-social.gemspec
|
67
|
+
files: []
|
96
68
|
homepage: https://github.com/nguyenthanhcong101096/omniauth-social
|
97
69
|
licenses:
|
98
70
|
- Apache-2.0
|
data/.gitignore
DELETED
data/CODE_OF_CONDUCT.md
DELETED
@@ -1,74 +0,0 @@
|
|
1
|
-
# Contributor Covenant Code of Conduct
|
2
|
-
|
3
|
-
## Our Pledge
|
4
|
-
|
5
|
-
In the interest of fostering an open and welcoming environment, we as
|
6
|
-
contributors and maintainers pledge to making participation in our project and
|
7
|
-
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
-
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
-
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
-
orientation.
|
11
|
-
|
12
|
-
## Our Standards
|
13
|
-
|
14
|
-
Examples of behavior that contributes to creating a positive environment
|
15
|
-
include:
|
16
|
-
|
17
|
-
* Using welcoming and inclusive language
|
18
|
-
* Being respectful of differing viewpoints and experiences
|
19
|
-
* Gracefully accepting constructive criticism
|
20
|
-
* Focusing on what is best for the community
|
21
|
-
* Showing empathy towards other community members
|
22
|
-
|
23
|
-
Examples of unacceptable behavior by participants include:
|
24
|
-
|
25
|
-
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
-
advances
|
27
|
-
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
-
* Public or private harassment
|
29
|
-
* Publishing others' private information, such as a physical or electronic
|
30
|
-
address, without explicit permission
|
31
|
-
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
-
professional setting
|
33
|
-
|
34
|
-
## Our Responsibilities
|
35
|
-
|
36
|
-
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
-
behavior and are expected to take appropriate and fair corrective action in
|
38
|
-
response to any instances of unacceptable behavior.
|
39
|
-
|
40
|
-
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
-
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
-
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
-
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
-
threatening, offensive, or harmful.
|
45
|
-
|
46
|
-
## Scope
|
47
|
-
|
48
|
-
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
-
when an individual is representing the project or its community. Examples of
|
50
|
-
representing a project or community include using an official project e-mail
|
51
|
-
address, posting via an official social media account, or acting as an appointed
|
52
|
-
representative at an online or offline event. Representation of a project may be
|
53
|
-
further defined and clarified by project maintainers.
|
54
|
-
|
55
|
-
## Enforcement
|
56
|
-
|
57
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
-
reported by contacting the project team at nguyenthanhcong101096@gmail.com. All
|
59
|
-
complaints will be reviewed and investigated and will result in a response that
|
60
|
-
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
-
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
-
Further details of specific enforcement policies may be posted separately.
|
63
|
-
|
64
|
-
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
-
faith may face temporary or permanent repercussions as determined by other
|
66
|
-
members of the project's leadership.
|
67
|
-
|
68
|
-
## Attribution
|
69
|
-
|
70
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
-
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
-
|
73
|
-
[homepage]: http://contributor-covenant.org
|
74
|
-
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
DELETED
data/Gemfile.lock
DELETED
@@ -1,153 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
omniauth-social (0.2.4)
|
5
|
-
omniauth-oauth2 (~> 1.3.1)
|
6
|
-
|
7
|
-
GEM
|
8
|
-
remote: https://rubygems.org/
|
9
|
-
specs:
|
10
|
-
actioncable (5.2.3)
|
11
|
-
actionpack (= 5.2.3)
|
12
|
-
nio4r (~> 2.0)
|
13
|
-
websocket-driver (>= 0.6.1)
|
14
|
-
actionmailer (5.2.3)
|
15
|
-
actionpack (= 5.2.3)
|
16
|
-
actionview (= 5.2.3)
|
17
|
-
activejob (= 5.2.3)
|
18
|
-
mail (~> 2.5, >= 2.5.4)
|
19
|
-
rails-dom-testing (~> 2.0)
|
20
|
-
actionpack (5.2.3)
|
21
|
-
actionview (= 5.2.3)
|
22
|
-
activesupport (= 5.2.3)
|
23
|
-
rack (~> 2.0)
|
24
|
-
rack-test (>= 0.6.3)
|
25
|
-
rails-dom-testing (~> 2.0)
|
26
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
27
|
-
actionview (5.2.3)
|
28
|
-
activesupport (= 5.2.3)
|
29
|
-
builder (~> 3.1)
|
30
|
-
erubi (~> 1.4)
|
31
|
-
rails-dom-testing (~> 2.0)
|
32
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
33
|
-
activejob (5.2.3)
|
34
|
-
activesupport (= 5.2.3)
|
35
|
-
globalid (>= 0.3.6)
|
36
|
-
activemodel (5.2.3)
|
37
|
-
activesupport (= 5.2.3)
|
38
|
-
activerecord (5.2.3)
|
39
|
-
activemodel (= 5.2.3)
|
40
|
-
activesupport (= 5.2.3)
|
41
|
-
arel (>= 9.0)
|
42
|
-
activestorage (5.2.3)
|
43
|
-
actionpack (= 5.2.3)
|
44
|
-
activerecord (= 5.2.3)
|
45
|
-
marcel (~> 0.3.1)
|
46
|
-
activesupport (5.2.3)
|
47
|
-
concurrent-ruby (~> 1.0, >= 1.0.2)
|
48
|
-
i18n (>= 0.7, < 2)
|
49
|
-
minitest (~> 5.1)
|
50
|
-
tzinfo (~> 1.1)
|
51
|
-
arel (9.0.0)
|
52
|
-
bindex (0.8.1)
|
53
|
-
builder (3.2.3)
|
54
|
-
concurrent-ruby (1.1.5)
|
55
|
-
crass (1.0.4)
|
56
|
-
erubi (1.8.0)
|
57
|
-
faraday (0.15.4)
|
58
|
-
multipart-post (>= 1.2, < 3)
|
59
|
-
globalid (0.4.2)
|
60
|
-
activesupport (>= 4.2.0)
|
61
|
-
hashie (3.6.0)
|
62
|
-
i18n (1.6.0)
|
63
|
-
concurrent-ruby (~> 1.0)
|
64
|
-
jwt (2.2.1)
|
65
|
-
loofah (2.2.3)
|
66
|
-
crass (~> 1.0.2)
|
67
|
-
nokogiri (>= 1.5.9)
|
68
|
-
mail (2.7.1)
|
69
|
-
mini_mime (>= 0.1.1)
|
70
|
-
marcel (0.3.3)
|
71
|
-
mimemagic (~> 0.3.2)
|
72
|
-
method_source (0.9.2)
|
73
|
-
mimemagic (0.3.3)
|
74
|
-
mini_mime (1.0.2)
|
75
|
-
mini_portile2 (2.4.0)
|
76
|
-
minitest (5.11.3)
|
77
|
-
multi_json (1.13.1)
|
78
|
-
multi_xml (0.6.0)
|
79
|
-
multipart-post (2.1.1)
|
80
|
-
nio4r (2.5.1)
|
81
|
-
nokogiri (1.10.4)
|
82
|
-
mini_portile2 (~> 2.4.0)
|
83
|
-
oauth2 (1.4.1)
|
84
|
-
faraday (>= 0.8, < 0.16.0)
|
85
|
-
jwt (>= 1.0, < 3.0)
|
86
|
-
multi_json (~> 1.3)
|
87
|
-
multi_xml (~> 0.5)
|
88
|
-
rack (>= 1.2, < 3)
|
89
|
-
omniauth (1.9.0)
|
90
|
-
hashie (>= 3.4.6, < 3.7.0)
|
91
|
-
rack (>= 1.6.2, < 3)
|
92
|
-
omniauth-oauth2 (1.3.1)
|
93
|
-
oauth2 (~> 1.0)
|
94
|
-
omniauth (~> 1.2)
|
95
|
-
rack (2.0.7)
|
96
|
-
rack-test (1.1.0)
|
97
|
-
rack (>= 1.0, < 3)
|
98
|
-
rails (5.2.3)
|
99
|
-
actioncable (= 5.2.3)
|
100
|
-
actionmailer (= 5.2.3)
|
101
|
-
actionpack (= 5.2.3)
|
102
|
-
actionview (= 5.2.3)
|
103
|
-
activejob (= 5.2.3)
|
104
|
-
activemodel (= 5.2.3)
|
105
|
-
activerecord (= 5.2.3)
|
106
|
-
activestorage (= 5.2.3)
|
107
|
-
activesupport (= 5.2.3)
|
108
|
-
bundler (>= 1.3.0)
|
109
|
-
railties (= 5.2.3)
|
110
|
-
sprockets-rails (>= 2.0.0)
|
111
|
-
rails-dom-testing (2.0.3)
|
112
|
-
activesupport (>= 4.2.0)
|
113
|
-
nokogiri (>= 1.6)
|
114
|
-
rails-html-sanitizer (1.2.0)
|
115
|
-
loofah (~> 2.2, >= 2.2.2)
|
116
|
-
railties (5.2.3)
|
117
|
-
actionpack (= 5.2.3)
|
118
|
-
activesupport (= 5.2.3)
|
119
|
-
method_source
|
120
|
-
rake (>= 0.8.7)
|
121
|
-
thor (>= 0.19.0, < 2.0)
|
122
|
-
rake (10.5.0)
|
123
|
-
sprockets (3.7.2)
|
124
|
-
concurrent-ruby (~> 1.0)
|
125
|
-
rack (> 1, < 3)
|
126
|
-
sprockets-rails (3.2.1)
|
127
|
-
actionpack (>= 4.0)
|
128
|
-
activesupport (>= 4.0)
|
129
|
-
sprockets (>= 3.0.0)
|
130
|
-
thor (0.20.3)
|
131
|
-
thread_safe (0.3.6)
|
132
|
-
tzinfo (1.2.5)
|
133
|
-
thread_safe (~> 0.1)
|
134
|
-
web-console (3.7.0)
|
135
|
-
actionview (>= 5.0)
|
136
|
-
activemodel (>= 5.0)
|
137
|
-
bindex (>= 0.4.0)
|
138
|
-
railties (>= 5.0)
|
139
|
-
websocket-driver (0.7.1)
|
140
|
-
websocket-extensions (>= 0.1.0)
|
141
|
-
websocket-extensions (0.1.4)
|
142
|
-
|
143
|
-
PLATFORMS
|
144
|
-
ruby
|
145
|
-
|
146
|
-
DEPENDENCIES
|
147
|
-
bundler (~> 1.17)
|
148
|
-
omniauth-social!
|
149
|
-
rails (~> 5.2)
|
150
|
-
web-console (~> 3.3, >= 3.3.0)
|
151
|
-
|
152
|
-
BUNDLED WITH
|
153
|
-
1.17.3
|
data/LICENSE.txt
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) 2019 nguyenthanhcong101096
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
13
|
-
all copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
THE SOFTWARE.
|
data/README.md
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
# Omniauth::Social
|
2
|
-
|
3
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/omniauth/social`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
6
|
-
|
7
|
-
## Installation
|
8
|
-
|
9
|
-
Add this line to your application's Gemfile:
|
10
|
-
|
11
|
-
```ruby
|
12
|
-
gem 'omniauth-social'
|
13
|
-
```
|
14
|
-
|
15
|
-
And then execute:
|
16
|
-
|
17
|
-
$ bundle
|
18
|
-
|
19
|
-
Or install it yourself as:
|
20
|
-
|
21
|
-
$ gem install omniauth-social
|
22
|
-
|
23
|
-
## Usage
|
24
|
-
|
25
|
-
TODO: Write usage instructions here
|
26
|
-
|
27
|
-
## Development
|
28
|
-
|
29
|
-
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
-
|
31
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
-
|
33
|
-
## Contributing
|
34
|
-
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/omniauth-social. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
36
|
-
|
37
|
-
## License
|
38
|
-
|
39
|
-
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
40
|
-
|
41
|
-
## Code of Conduct
|
42
|
-
|
43
|
-
Everyone interacting in the Omniauth::Social project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/omniauth-social/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
DELETED
data/bin/console
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "bundler/setup"
|
4
|
-
require "omniauth/social"
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require "irb"
|
14
|
-
IRB.start(__FILE__)
|
data/bin/setup
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
module Omniauth
|
2
|
-
module Social::Callbacks
|
3
|
-
def google_oauth2
|
4
|
-
signin_and_redirect
|
5
|
-
end
|
6
|
-
|
7
|
-
def facebook
|
8
|
-
signin_and_redirect
|
9
|
-
end
|
10
|
-
|
11
|
-
def twitter
|
12
|
-
signin_and_redirect
|
13
|
-
end
|
14
|
-
|
15
|
-
private
|
16
|
-
|
17
|
-
def signin_and_redirect
|
18
|
-
Social::Service.new(request, self).execute do |success, failure|
|
19
|
-
success.call { redirect_to root_path, notice: t('.notice') }
|
20
|
-
failure.call { redirect_to root_path, alert: t('.alert') }
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,63 +0,0 @@
|
|
1
|
-
module Omniauth
|
2
|
-
class Social::Service
|
3
|
-
attr_reader :provider_data, :controller
|
4
|
-
|
5
|
-
def initialize(auth, controller)
|
6
|
-
@provider_data = auth.env['omniauth.auth']
|
7
|
-
@controller = controller
|
8
|
-
end
|
9
|
-
|
10
|
-
def execute
|
11
|
-
if signin_via_social
|
12
|
-
yield(PostService::Success, PostService::Failure)
|
13
|
-
else
|
14
|
-
yield(PostService::Failure, PostService::Success)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
private
|
19
|
-
|
20
|
-
def signin_via_social
|
21
|
-
false unless @provider_data
|
22
|
-
|
23
|
-
account = AuthProvider.find_by(provider_params)&.user || User.find_by(email: provider_data.info.email)
|
24
|
-
|
25
|
-
if account
|
26
|
-
account.auth_providers.find_or_create_by(provider_params)
|
27
|
-
else
|
28
|
-
account = User.create!(user_params)
|
29
|
-
account.auth_providers.create(provider_params)
|
30
|
-
end
|
31
|
-
|
32
|
-
controller.sign_in(account)
|
33
|
-
controller.session[:user] = account.email
|
34
|
-
true
|
35
|
-
end
|
36
|
-
|
37
|
-
def provider_params
|
38
|
-
{ uid: provider_data.uid, provider: provider_data.provider }
|
39
|
-
end
|
40
|
-
|
41
|
-
def user_params
|
42
|
-
{ username: provider_data.info.name, email: provider_data.info.email, avatar: avatar(provider_data.info.image) }
|
43
|
-
end
|
44
|
-
|
45
|
-
def avatar(url)
|
46
|
-
file = Tempfile.new
|
47
|
-
file.binmode
|
48
|
-
file.write open(url).read
|
49
|
-
file.rewind
|
50
|
-
file
|
51
|
-
end
|
52
|
-
|
53
|
-
class Success
|
54
|
-
def self.call
|
55
|
-
yield
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
class Failure
|
60
|
-
def self.call; end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
data/lib/omniauth/social.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'rails'
|
2
|
-
require 'set'
|
3
|
-
require 'active_support/dependencies'
|
4
|
-
require 'omniauth/social/version'
|
5
|
-
require 'omniauth/strategies/line'
|
6
|
-
|
7
|
-
module Omniauth
|
8
|
-
module Social
|
9
|
-
autoload :Service, 'omniauth/social/service'
|
10
|
-
autoload :Callbacks, 'omniauth/social/callbacks'
|
11
|
-
|
12
|
-
class Error < StandardError; end
|
13
|
-
class Engine < ::Rails::Engine; end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,38 +0,0 @@
|
|
1
|
-
require 'omniauth-oauth2'
|
2
|
-
require 'json'
|
3
|
-
|
4
|
-
module OmniAuth
|
5
|
-
module Strategies
|
6
|
-
class Line < OmniAuth::Strategies::OAuth2
|
7
|
-
option :name, 'line'
|
8
|
-
option :scope, 'profile openid'
|
9
|
-
|
10
|
-
option :client_options, {
|
11
|
-
site: 'https://access.line.me',
|
12
|
-
authorize_url: '/oauth2/v2.1/authorize',
|
13
|
-
token_url: '/oauth2/v2.1/token'
|
14
|
-
}
|
15
|
-
|
16
|
-
def callback_phase
|
17
|
-
options[:client_options][:site] = 'https://api.line.me'
|
18
|
-
super
|
19
|
-
end
|
20
|
-
|
21
|
-
uid { raw_info['userId'] }
|
22
|
-
|
23
|
-
info do
|
24
|
-
{
|
25
|
-
name: raw_info['displayName'],
|
26
|
-
image: raw_info['pictureUrl'],
|
27
|
-
description: raw_info['statusMessage']
|
28
|
-
}
|
29
|
-
end
|
30
|
-
|
31
|
-
def raw_info
|
32
|
-
@raw_info ||= JSON.load(access_token.get('v2/profile').body)
|
33
|
-
rescue ::Errno::ETIMEDOUT
|
34
|
-
raise ::Timeout::Error
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
data/omniauth-social-0.1.0.gem
DELETED
Binary file
|
data/omniauth-social-0.1.1.gem
DELETED
Binary file
|
data/omniauth-social-0.1.2.gem
DELETED
Binary file
|
data/omniauth-social-0.1.3.gem
DELETED
Binary file
|
data/omniauth-social-0.1.4.gem
DELETED
Binary file
|
data/omniauth-social-0.1.5.gem
DELETED
Binary file
|
data/omniauth-social-0.1.6.gem
DELETED
Binary file
|
data/omniauth-social-0.1.7.gem
DELETED
Binary file
|
data/omniauth-social-0.1.8.gem
DELETED
Binary file
|
data/omniauth-social-0.1.9.gem
DELETED
Binary file
|
data/omniauth-social-0.2.1.gem
DELETED
Binary file
|
data/omniauth-social-0.2.2.gem
DELETED
Binary file
|
data/omniauth-social-0.2.3.gem
DELETED
Binary file
|
data/omniauth-social.gemspec
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
|
2
|
-
lib = File.expand_path("../lib", __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require "omniauth/social/version"
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = "omniauth-social"
|
8
|
-
spec.version = Omniauth::Social::VERSION
|
9
|
-
spec.authors = ["nguyenthanhcong101096"]
|
10
|
-
spec.email = ["nguyenthanhcong101096@gmail.com"]
|
11
|
-
|
12
|
-
spec.summary = "this is the all module for wakuwaku appkication"
|
13
|
-
spec.description = "Write a longer description or delete this line."
|
14
|
-
spec.homepage = "https://github.com/nguyenthanhcong101096/omniauth-social"
|
15
|
-
spec.license = "Apache-2.0"
|
16
|
-
|
17
|
-
# Specify which files should be added to the gem when it is released.
|
18
|
-
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
19
|
-
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
20
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
21
|
-
end
|
22
|
-
spec.bindir = "exe"
|
23
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
|
-
spec.require_paths = ["lib"]
|
25
|
-
|
26
|
-
spec.add_development_dependency 'bundler', '~> 1.17'
|
27
|
-
spec.add_development_dependency 'web-console', '~> 3.3', '>= 3.3.0'
|
28
|
-
spec.add_dependency 'omniauth-oauth2', '~> 1.3.1'
|
29
|
-
# spec.add_dependency 'omniauth-oauth', '~> 1.1'
|
30
|
-
end
|