Does anyone know how I can get the credentials of the logged user in a heroku dyno?
Context: We are trying to log access to Heroku production rails console
. People access it via heroku run
or heroku exec
. Heroku does authenticate the users executed the command, however, I'm unable to retrieve this information once the rails console is started.
It looks like heroku
cli is not available in the dyno, and whoami
returns dyno
.
Eg:
$ heroku run rails c -a opt-prod
<in rails console>
irb(main):001:0> ENV
irb(main):001:0> `whoami`