makersquare/clicker — pull request #8 by lolptdr (2014-09-09 05:01:05+00:00)
Title: Omniauth with Github API Implementation

- **Gemfile**: added three gems -- Omniauth, better_errors, and binding_of_caller (latter two are in development group)
- **app/models/user.rb**: created User model with create_with_omniauth method
- **app/controllers/sessions, users, application**: created Sessions (create and destroy) and Users (new) methods; modified application controller to contain private method for 'current_user'
- **config/routes.rb**: updated routes for auth/github/callback and signout; root set to "users#new"
- **config/initializers**: added 'better_errors.rb' vagrant fix and 'omniauth.rb' yml file call for github keys
- **app/views/users/new.html.erb**: made a simple view for linking to github sign-in "/auth/github"
- **.gitignore**: "config/_omniauth.yml" stored github client ID and secret in a separate yml file referenced by initializer omniauth file

...will proceed to create tests

#### References:
* Method to Store ENV variables: http://stackoverflow.com/questions/11648620/setting-environment-variables-in-rails-3-devise-omniauth
* Method for Github/OmniAuth Implementation: http://justusunlimited.com/2014/01/08/integrating-github-oauth-into-an-existing-rails-application/ and http://natashatherobot.com/rails-omniauth-github-tutorial/