Update credentials_controller.rb

Compacting the logic to trim the fat from this project.