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 trial

Ruby

How 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
Brandon McClelland
4,645 Points

My 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.

Oh, 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.

Brandon McClelland
Brandon McClelland
4,645 Points

Since 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.