lynndylanhurley / devise_token_auth

Token based authentication for Rails JSON APIs. Designed to work with jToker and ng-token-auth.
Do What The F*ck You Want To Public License
3.52k stars 1.14k forks source link

Return `other_uid` in auth headers and encode in bearer token #1583

Open benkovy opened 1 year ago

benkovy commented 1 year ago

Devise Token Auth provides a way to specify your own uid column. This column is respected when setting the current resource, however we do not expose this field in the auth headers (or encode it in the bearer token as a result).

Within DeviseTokenAuth::Concerns::User (particularly this method) I believe we should also return the custom uid in the headers so it can then be used by the client to store/reference after successful login or registration.

mickamy commented 1 year ago

Just curious but what is the purpose of other_id, or should I say what is the use-cases of it? Isn't just a uid is not enought?

bettysteger commented 9 months ago

I would need to identify this for users that have the same email address... will this be added to the auth headers?