metova 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/app/controllers/metova/api/sessions_controller.rb +9 -3
- data/lib/metova/error.rb +3 -0
- data/lib/metova/oauth/facebook_provider.rb +4 -0
- data/lib/metova/oauth/flux_provider.rb +4 -0
- data/lib/metova/oauth/generic_provider.rb +4 -0
- data/lib/metova/oauth/google_provider.rb +4 -0
- data/lib/metova/oauth/twitter_provider.rb +4 -0
- data/lib/metova/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZDFiZDg5N2UxN2E5ZDIxY2NiMmI4YjhkYzRmY2Y3OGIzYWFjYjA0ZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MWEzZTNkYmY5OWNiNGYwNzVlOGQwMWRiODg4Y2EwMWUzODY5ZGVlZg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZDhlYzQ1YzdlZDk5MDcxZTk2NzAzMGNiZTBiYTMxMzM1MGRjNTI3NzgxMDU0
|
10
|
+
Yzc2OWFkNGM0ZWI0Y2E1NTEwMDZmMWRlYTA2MzQ5YTY1MjkxNzdlNGU5ZDZh
|
11
|
+
NjNkYjNlM2QzZmFmMjM4Mjc5MGRjMTliOGVlMmQ2MDFlYWZiZTE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NmIzNjU1NDc4YmI0NjJkOTc5NDQxYmVlYmZmNGQ2NTRjOTA5NzYwMDQxN2Zk
|
14
|
+
ZGZhYTk5YmY4MGExY2FkMDNlOGE1YzY4ZjFiMDE2YWVlMzkzZTM5NmQ5OTg2
|
15
|
+
ZDY5YzI1MGRlZTllNTBhOTljM2U5M2UxMmIzOWZhYzhhOGU0NDM=
|
@@ -1,5 +1,6 @@
|
|
1
1
|
class Metova::API::SessionsController < ::Devise::SessionsController
|
2
2
|
respond_to :json
|
3
|
+
self.responder = Metova::Responder
|
3
4
|
|
4
5
|
def create
|
5
6
|
if params[:provider]
|
@@ -42,10 +43,15 @@ class Metova::API::SessionsController < ::Devise::SessionsController
|
|
42
43
|
|
43
44
|
def sign_up_user(auth, identity)
|
44
45
|
user = User.new Hash[email: auth.info.email, password: SecureRandom.hex].merge(sign_in_params)
|
45
|
-
|
46
|
-
|
46
|
+
identity.user = user
|
47
|
+
if identity.valid?
|
48
|
+
if user.save and identity.save
|
49
|
+
sign_in_user user
|
50
|
+
else
|
51
|
+
respond_with user
|
52
|
+
end
|
47
53
|
else
|
48
|
-
|
54
|
+
render json: Metova::GenericError.new("#{auth.name} authentication failed")
|
49
55
|
end
|
50
56
|
end
|
51
57
|
end
|
data/lib/metova/error.rb
CHANGED
data/lib/metova/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metova
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Logan Serman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|