2

I'm using Rails 3.0 and Devise 1.1.7. In order to develop some API behavior, I enabled the TokenAuthentication functionality.

The thing is, when I try to access with an auth_token parameter, the current_user is not being set properly. Should it? Or am I missing something?

Thank you in advanced.

1 Answers1

0

You could try adding this to the user model:

before_save :ensure_authentication_token

This will ensure an authentication token exists (creating one if not) before you save your user. There is also a reset_authentication_token if you want to change it.

Leonel Galán
  • 6,993
  • 2
  • 41
  • 60