2017-09-25 07:10:25 +00:00
|
|
|
module GoogleApi
|
|
|
|
class AuthorizationsController < ApplicationController
|
|
|
|
def callback
|
2017-09-25 17:11:26 +00:00
|
|
|
session[GoogleApi::CloudPlatform::Client.token_in_session] =
|
|
|
|
GoogleApi::Authentication.new(nil, callback_google_api_authorizations_url)
|
|
|
|
.get_token(params[:code])
|
2017-09-25 07:10:25 +00:00
|
|
|
|
|
|
|
if params[:state]
|
|
|
|
redirect_to params[:state]
|
|
|
|
else
|
|
|
|
redirect_to root_url
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|