From c511e08ab70d417e602509f28e96d9889410a3ce Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Mon, 13 May 2019 22:43:14 +0200 Subject: [PATCH] Fix: Even with offline access no refresh token is present Signed-off-by: Knut Ahlers --- plugins/auth/google/auth.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/auth/google/auth.go b/plugins/auth/google/auth.go index 477548b..ad4ef05 100644 --- a/plugins/auth/google/auth.go +++ b/plugins/auth/google/auth.go @@ -162,7 +162,11 @@ func (a *AuthGoogleOAuth) Login(res http.ResponseWriter, r *http.Request) (user // method. If no login using this method is possible the function // needs to return nil. func (a *AuthGoogleOAuth) LoginFields() (fields []plugins.LoginField) { - loginURL := a.getOAuthConfig().AuthCodeURL(a.AuthenticatorID(), oauth2.AccessTypeOffline) + loginURL := a.getOAuthConfig().AuthCodeURL( + a.AuthenticatorID(), + oauth2.AccessTypeOffline, + oauth2.SetAuthURLParam("prompt", "consent"), + ) return []plugins.LoginField{ {