I'm getting only access_token when I use this code.
url = URI("https://www.googleapis.com/oauth2/v4/token")
secrets = {
code: params[:code],
client_id: Rails.application.secrets.google[:client_id],
client_secret: Rails.application.secrets.google[:client_secret],
grant_type: "authorization_code",
redirect_uri: Rails.application.secrets.front_end_domain
}
response = Net::HTTP.post_form(url, secrets)
json_response = JSON.parse(response.read_body)
How to change the code so that I can get the refresh_token every time?