artfully_ose 1.3.0.pre2 → 1.3.0.pre3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/mobile/users_controller.rb +7 -19
- data/lib/artfully_ose/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2fbca74b3c729a037bb45f57968f80d5f307c6bf
|
4
|
+
data.tar.gz: d82ddcd5912ed3aaabb3070d5fecca425f581482
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1df7b7aeff9f5aa8d33a9319c688b0bb71453a2f79885a04c2c39aff2da05da5459d2771769b0aff8d0e54261ddcbdf4a3cec832902766e68418c7d7134bec02
|
7
|
+
data.tar.gz: df671c3cd62c19462a95c709abc93f6dec9cff3b0194646c3d1507128cd8a6f8540a490393ef9229ed4cd7dc6c7012f160e0542a2a105438ded262103b5355d7
|
@@ -1,27 +1,15 @@
|
|
1
1
|
class Mobile::UsersController < ApplicationController
|
2
2
|
skip_before_filter :authenticate_user!, :only => :sign_in
|
3
|
-
include Ext::MobileAuthenticator
|
4
3
|
|
5
4
|
def sign_in
|
6
|
-
|
5
|
+
user = User.find_by_email(params[:email])
|
7
6
|
|
8
|
-
if
|
9
|
-
@user = User.find_by_fa_user_id(response["extra_attributes"]["id"])
|
7
|
+
if user && user.valid_password?(params[:password])
|
10
8
|
|
11
|
-
if
|
9
|
+
if user.organizations.empty?
|
12
10
|
error = {
|
13
11
|
:error => "Could not sign in",
|
14
|
-
:reason => "
|
15
|
-
:code => 2
|
16
|
-
}
|
17
|
-
render :json => error, :status => 422 and return
|
18
|
-
end
|
19
|
-
|
20
|
-
|
21
|
-
if @user.organizations.empty?
|
22
|
-
error = {
|
23
|
-
:error => "Could not sign in",
|
24
|
-
:reason => "You are not a member of any organizations",
|
12
|
+
:reason => "User is not a member of any organizations",
|
25
13
|
:code => 2
|
26
14
|
}
|
27
15
|
render :json => error, :status => 422 and return
|
@@ -29,14 +17,14 @@ class Mobile::UsersController < ApplicationController
|
|
29
17
|
|
30
18
|
now = Time.parse(params[:now]) rescue Time.zone.now
|
31
19
|
|
32
|
-
render :json =>
|
20
|
+
render :json => user, :auth_token => true, :organization => user.organizations.first, :now => now
|
33
21
|
else
|
34
22
|
error = {
|
35
23
|
:error => "Could not sign in",
|
36
|
-
:reason => "Invalid email
|
24
|
+
:reason => "Invalid email/password",
|
37
25
|
:code => 1
|
38
26
|
}
|
39
27
|
render :json => error, :status => 422
|
40
28
|
end
|
41
29
|
end
|
42
|
-
end
|
30
|
+
end
|
data/lib/artfully_ose/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: artfully_ose
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.0.
|
4
|
+
version: 1.3.0.pre3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Artful.ly
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|