artfully_ose 1.3.0.pre2 → 1.3.0.pre3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2227e62aa7b96bf9b47c53b10e6f7be5e505b8d2
4
- data.tar.gz: 2730b7c985317b350a7375e3d323ce1625652f77
3
+ metadata.gz: 2fbca74b3c729a037bb45f57968f80d5f307c6bf
4
+ data.tar.gz: d82ddcd5912ed3aaabb3070d5fecca425f581482
5
5
  SHA512:
6
- metadata.gz: a1d9292c210b7f9eb3a73b4ab50be727c9a2963b494475ce7b2638d7f3ca8f1d5958972af8fb1f14c146b054be255d74c6dde8c7148933caa07a395061a94988
7
- data.tar.gz: e94e5cda62a1e681e59f7dfffe0621018b3ea8c9c84c414e8ed4d51aac6bf7d58bc0ad6b0d8410d306e4f1379d3241a57a73d0283fbefb7a18f4dcba8d4feb33
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
- Rails.logger.debug("------- MOBILE LOGIN -------")
5
+ user = User.find_by_email(params[:email])
7
6
 
8
- if response = valid_login?
9
- @user = User.find_by_fa_user_id(response["extra_attributes"]["id"])
7
+ if user && user.valid_password?(params[:password])
10
8
 
11
- if @user.nil?
9
+ if user.organizations.empty?
12
10
  error = {
13
11
  :error => "Could not sign in",
14
- :reason => "Please go to fracturedatlas.org to activate your artful.ly organization",
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 => @user, :auth_token => true, :organization => @user.organizations.first, :now => now
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 and password",
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
@@ -1,3 +1,3 @@
1
1
  module ArtfullyOse
2
- VERSION = "1.3.0.pre2"
2
+ VERSION = "1.3.0.pre3"
3
3
  end
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.pre2
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-18 00:00:00.000000000 Z
11
+ date: 2015-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails