app/controllers/students/omniauth_callbacks_controller.rb
# You should also create an action method in this controller like this:
You should also create an action method in this controller like this.
You should also create an action method in this controller like this .
def github
    @user = Student.from_omniauth(request.env["omniauth.auth"])
    if @user.persisted?
      sign_in_and_redirect @user, :event => :authentication 
      set_flash_message(:notice, :success, :kind => "Github") if is_navigational_format?
    else
      session["devise.github_data"] = request.env["omniauth.auth"]
      redirect_to new_user_registration_url
    end
  end
def github @user = Student . from_omniauth ( request . env [ "omniauth.auth" ] ) if @user . persisted? sign_in_and_redirect @user , :event => :authentication set_flash_message ( :notice , :success , :kind => "Github" ) if is_navigational_format? else session [ "devise.github_data" ] = request . env [ "omniauth.auth" ] redirect_to new_user_registration_url end end
You should also create an action method in this controller like this:
You should also create an action method in this controller like this :
# You need to implement the method below in your model (e.g. app/models/user.rb) #this will throw if @user is not activated