summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2017-04-20 15:59:18 +0200
committerAzul <azul@riseup.net>2017-04-20 15:59:18 +0200
commit653f92e6ac5c0b61e8113665735d929426deb714 (patch)
treebd79d0b810377cc25b668aded2fd5cdd053c4d11 /app
parentdaa9b1ed04417c8ead2558a1c616d0321c085790 (diff)
fix: set token in forms correctly
We now use the hash of the token for comparison and as the id. In order to use it you need the original token though. So forms and thus the session should have token.to_s rather than token.id.
Diffstat (limited to 'app')
-rw-r--r--app/controllers/api/sessions_controller.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/api/sessions_controller.rb b/app/controllers/api/sessions_controller.rb
index 178f86e..3883115 100644
--- a/app/controllers/api/sessions_controller.rb
+++ b/app/controllers/api/sessions_controller.rb
@@ -25,7 +25,7 @@ module Api
def update
authenticate!
@token = Token.create(:user_id => current_user.id)
- session[:token] = @token.id
+ session[:token] = @token.to_s
render :json => login_response
end