Change all api tokens automatically
Replies (1)
(1-1/1)
Added by Fabio Sousa over 1 year ago
Hello,
Do you have any tips on how I can change automatically the api tokens for all my users ?
Thank you.
Hi, seems quite simple.
From rails console run:
User.all.each do |user|
user.api_token.try(:destroy)
user.reload
end
Please try the code on your own risk (not tested and provided as example, try it in development environment first and see effects).
Thanks
Lorenzo
(1-1/1)