app/controllers/googledrive_controller.rb
# connect to the Google API and begin the process of autheticating
connect to the Google API and begin the process of autheticating
connect to the Google API and begin the process of autheticating
def connect
    if connected_to_google_api?
      redirect_to finish_googledrive_index_url
    else
      client = oauth2client
      redirect_to client.authorization_uri(approval_prompt: 'force').to_s
    end
  end
def connect if connected_to_google_api? redirect_to finish_googledrive_index_url else client = oauth2client redirect_to client . authorization_uri ( approval_prompt : 'force' ) . to_s end end
connect to the Google API and begin the process of autheticating
connect to the Google API and begin the process of autheticating
# if we're already connected to the API # just redirect straight to the finish # otherwise, create a new oauth2 client and redirect to Google's authorisation page