From 93d242c404d0dc2526688ba93e9046481c6cb565 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Mon, 13 May 2019 21:23:14 +0200 Subject: [PATCH] Fix: Google not returning refresh tokens which then causes logins with duration of more than 60m to time out and not be able to refresh as of the missing refresh token. The "offline" access type should ensure the token always contains a refresh token and the user can be active for longer than 60m. Signed-off-by: Knut Ahlers --- plugins/auth/google/auth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/auth/google/auth.go b/plugins/auth/google/auth.go index fe3ba3f..477548b 100644 --- a/plugins/auth/google/auth.go +++ b/plugins/auth/google/auth.go @@ -162,7 +162,7 @@ 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()) + loginURL := a.getOAuthConfig().AuthCodeURL(a.AuthenticatorID(), oauth2.AccessTypeOffline) return []plugins.LoginField{ {