This repo is a barebones Rails application with my implementation of Devise/Omniauth/user mgt (change email/password).
Download/clone this repo, bundle gems, then run the rails server.
I recommend playing around with it a little bit before diving into the code too deeply.