fixed token authentication generation

This pull request fixes an issue where token authentications were not being generated on the user model. I plan on merging this fix immediately. Tests are included.