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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f19438bf6c591a3cfbc11cfad121c74e5e7f2c58
4
- data.tar.gz: 418a227b98a10fc024e8a54323fe2d5a8cf46ba9
3
+ metadata.gz: 15791b823d4e5952e335450659eea8b83e9b421b
4
+ data.tar.gz: 440502a760c9e0f0039cd22d98a67a9ddcfd1ad3
5
5
  SHA512:
6
- metadata.gz: 429f16cad018e754d981d954acbfbaa4e233e1a2b5ad6aa664d1fb0b40409ba530b14e2078f774fecf549c39ab6cda0f2d560d26054439aca67136df2e7c9ad4
7
- data.tar.gz: cc1b2a1e1a60572d2d46b2246fdda2fdc9317f3cf35931acca54ca80b9562df10ac83d3474f03ded00a25216254dc3e2b1b4fbcb8053b019f7106c07c8284dc7
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
- render json: resource
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
@@ -1,5 +1,5 @@
1
1
  module Remotty
2
2
  module Rails
3
- VERSION = '0.0.8'
3
+ VERSION = '0.0.9'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remotty-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chungsub Kim