diff options
author | Azul <azul@leap.se> | 2013-08-27 11:14:30 +0200 |
---|---|---|
committer | Azul <azul@leap.se> | 2013-08-27 14:57:44 +0200 |
commit | e60ee749cab0f80cf23ca57e28c7de6d1b3a395b (patch) | |
tree | 9c647de3952d8f8fe78fc4fcb06de0d504c436d5 /users/app | |
parent | 7ad6d054d72d3c76098f689e4e7890265a3604c8 (diff) |
basic testing for token based auth in tests
Diffstat (limited to 'users/app')
-rw-r--r-- | users/app/controllers/controller_extension/token_authentication.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/users/app/controllers/controller_extension/token_authentication.rb b/users/app/controllers/controller_extension/token_authentication.rb index 71dbc50..06e9e04 100644 --- a/users/app/controllers/controller_extension/token_authentication.rb +++ b/users/app/controllers/controller_extension/token_authentication.rb @@ -2,11 +2,10 @@ module ControllerExtension::TokenAuthentication extend ActiveSupport::Concern def token_authenticate - token = nil - authenticate_or_request_with_http_token do |token, options| - token = Token.find(token) + authenticate_or_request_with_http_token do |token_id, options| + @token = Token.find(token_id) end - User.find(token.user_id) if token + User.find_by_param(@token.user_id) if @token end end |