summaryrefslogtreecommitdiff
path: root/users/app
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2013-04-02 12:45:58 +0200
committerAzul <azul@leap.se>2013-04-09 09:01:34 +0200
commit2bd36ec96d42f0b4585a15759f33ff7f89075dcc (patch)
treebc523084497325e43a373babc887a1c06f19b327 /users/app
parent08ce330fd3676ba0b51d604a2aa653c680fffea5 (diff)
return token on successful login via api
Diffstat (limited to 'users/app')
-rw-r--r--users/app/controllers/v1/sessions_controller.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/users/app/controllers/v1/sessions_controller.rb b/users/app/controllers/v1/sessions_controller.rb
index 9365d76..e3459d6 100644
--- a/users/app/controllers/v1/sessions_controller.rb
+++ b/users/app/controllers/v1/sessions_controller.rb
@@ -23,6 +23,7 @@ module V1
def update
authenticate!
+ @token = Token.create(:user_id => current_user.id)
render :json => login_response
end
@@ -35,7 +36,7 @@ module V1
def login_response
handshake = session.delete(:handshake)
- handshake.to_hash.merge(:id => current_user.id)
+ handshake.to_hash.merge(:id => current_user.id, :token => @token.id)
end
end