remotty-rails 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/app/controllers/remotty/users/sessions_controller.rb +10 -1
- data/lib/remotty/rails/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15791b823d4e5952e335450659eea8b83e9b421b
|
4
|
+
data.tar.gz: 440502a760c9e0f0039cd22d98a67a9ddcfd1ad3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ac6c065325e88a4d15428f6f9f94ff67bd778d264fbd4b19106296785c6d337e0f338d447f9d677bf06688642fa59f0cafbb7790e88bcf0c4f945fc931d37e1
|
7
|
+
data.tar.gz: 779b0f0d918fd4c4154ad7684e466ae8d37e8e03110b685f67c23b509ce36a03f5631a1de4da928a8692ab72b11282ea2ad37880de0dcc7ae7ac50c3d473058e
|
data/README.md
CHANGED
@@ -163,6 +163,7 @@ devise_for :users,
|
|
163
163
|
omniauth_callbacks: 'remotty/users/omniauth_callbacks'}
|
164
164
|
|
165
165
|
devise_scope :user do
|
166
|
+
get 'api/v1/session' => 'remotty/users/sessions#show'
|
166
167
|
post 'api/v1/session/avatar' => 'remotty/users/registrations#avatar'
|
167
168
|
delete 'api/v1/session/avatar' => 'remotty/users/registrations#remove_avatar'
|
168
169
|
end
|
@@ -51,6 +51,15 @@ class Remotty::Users::SessionsController < Devise::SessionsController
|
|
51
51
|
# * +failure+ - unauthentication with error message
|
52
52
|
#
|
53
53
|
def show
|
54
|
-
|
54
|
+
resource = warden.authenticate(:scope => resource_name)
|
55
|
+
if resource
|
56
|
+
render json: resource
|
57
|
+
else
|
58
|
+
render json: {
|
59
|
+
error: {
|
60
|
+
code: "UNAUTHENTICATION"
|
61
|
+
}
|
62
|
+
}
|
63
|
+
end
|
55
64
|
end
|
56
65
|
end
|