Advertisement
Outlaw909

Untitled

Jul 25th, 2015
559
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. sign_in_and_redirect user_path, :event => :authentication
  2.  
  3. user GET /users/:id(.:format) users#show
  4.  
  5. user = User.create(
  6. ## id: current_user.id,https://www.facebook.com/rachel.garrison/password/email/login?
  7. name:auth.extra.raw_info.name,
  8. provider:auth.provider,
  9. uid:auth.uid,
  10. email:auth.info.email,
  11. password:Devise.friendly_token[0,20],
  12. )
  13.  
  14. sign_in_and_redirect user_path(current_user), :event => :authentication
  15.  
  16. sign_in_and_redirect resource, :event => :authentication
  17.  
  18. def oauthorize(kind)
  19. @user = find_for_ouath(kind, env["omniauth.auth"], current_user)
  20.  
  21. if @user
  22. kind = 'Google+' if kind == 'GPlus'
  23. flash[:notice] = I18n.t "devise.omniauth_callbacks.success", :kind => kind
  24. session["devise.#{kind.downcase}_data"] = env["omniauth.auth"]
  25. # this is the line you need to look at
  26. sign_in_and_redirect @user, :event => :authentication
  27. end
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement