# File lib/oauth/controllers/consumer_controller.rb, line 47
      def callback2
        @token = @consumer.access_token(current_user,params[:code], callback2_oauth_consumer_url)
        if @token
          # Log user in
          if logged_in?
            flash[:notice] = "#{params[:id].humanize} was successfully connected to your account"
          else
            self.current_user = @token.user
            flash[:notice] = "You logged in with #{params[:id].humanize}"
          end
          go_back
        else
          flash[:error] = "An error happened, please try connecting again"
          redirect_to oauth_consumer_url(params[:id])
        end

      end