From 1c968797ec0b262346ee27682b4188fab66105f0 Mon Sep 17 00:00:00 2001 From: Metin Akat Date: Tue, 20 Aug 2024 18:55:40 +0300 Subject: [PATCH] Add code to request a refresh_token from google This will force Google to return a refresh_token used to request new auth_code when it expires --- examples/google.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/google.rs b/examples/google.rs index d3dba53..591e084 100644 --- a/examples/google.rs +++ b/examples/google.rs @@ -74,6 +74,10 @@ fn main() { .add_scope(Scope::new( "https://www.googleapis.com/auth/plus.me".to_string(), )) + // refresh_token - also request a refresh token if you need to automatically refresh the access token + .add_extra_param("access_type", "offline".to_string()) + .add_extra_param("prompt", "consent".to_string()) + // end refresh_token .set_pkce_challenge(pkce_code_challenge) .url();