Created
January 16, 2017 05:08
-
-
Save 1c7/bd0c5e9aa941634eb9d4c7382b4e6451 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class OmniauthCallbackController < Devise::OmniauthCallbacksController | |
| def wechat | |
| @user = User.from_omniauth(request.env["omniauth.auth"]) | |
| if @user.persisted? | |
| sign_in_and_redirect @user, :event => :authentication | |
| else | |
| session["devise.wechat_data"] = request.env["omniauth.auth"] | |
| redirect_to new_user_registration_url | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment