saasbook

omniauth_example.rb

Aug 21st, 2012
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.24 KB | None | 0 0
  1. class SessionsController < ApplicationController
  2.   def create
  3.     @user = User.find_or_create_from_auth_hash(auth_hash)
  4.     self.current_user = @user
  5.     redirect_to '/'
  6.   end
  7.   protected
  8.   def auth_hash
  9.     request.env['omniauth.auth']
  10.   end
  11. end
Advertisement
Add Comment
Please, Sign In to add comment