I was noticing that every user in my system has a token auth tab on their user profile page and has a token generated for them (also verified by looking at the db table) even if they can't use token auth.

Is this by design? Shouldn't it only generate a token for a user if that user is in a role that has permissions to be able to use token auth? perhaps in a hook when the user is saved and added to an applicable role?

I'm wondering because my site has over 90k users and now there is a huge table in the db with lots of tokens that will never be used, and simply enabling the module got me an out-of-memory error in my environment.

CommentFileSizeAuthor
#2 remove-enable-hook.patch774 bytespebosi

Comments

pebosi’s picture

Version: 7.x-1.0-alpha1 » 7.x-1.x-dev
Component: Miscellaneous » Code

This is by design.

But i also would prefer to remove this, simply be removing "tokenauth_enable" from .install file.

pebosi’s picture

Status: Active » Needs review
StatusFileSize
new774 bytes

If the idea finds encouragement, you could use attached patch.