Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialGabriel Marez
46 PointsHow to show devise password - Ruby on Rails
Hi i have been using rails for a while and i know that when you use devise (ruby gem), is encrypted on the database but i need to show a reports of users with complete information (with password on plain text). Is there any way to show the passwords?
2 Answers
Brandon McClelland
4,645 PointsMy understanding is it is not possible by default. And for good reason. There is almost no normal scenario where you would want to be able to do this; it kinda defeats the purpose of using security in the first place.
So please explain why you think your report should include such a total disregard of your user's security. Maybe there is an alternate solution to help you achieve your end goal.
Brandon McClelland
4,645 PointsSince Devise stores the encrypted version you could watch for changes to that field and log the user change. You should definitely check the law to see what exactly you need to store to comply with an audit request.
Gabriel Marez
46 PointsGabriel Marez
46 PointsOh, it's because when a audit happen they need to know what have been the passwords' changes on the time. So i wanted to do that, maybe i just can show the dates when the changes have occurred and who did it but im not pretty sure if the law says that.