From 864847f4190b7ca32fee02ef69c33c81c731edea Mon Sep 17 00:00:00 2001 From: Jeroen Oudshoorn Date: Fri, 13 Oct 2023 20:56:28 +0200 Subject: [PATCH] v2.4.7 Signed-off-by: Jeroen Oudshoorn --- pwnagotchi/plugins/default/gdrivesync.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/pwnagotchi/plugins/default/gdrivesync.py b/pwnagotchi/plugins/default/gdrivesync.py index f15e4125..674981fd 100644 --- a/pwnagotchi/plugins/default/gdrivesync.py +++ b/pwnagotchi/plugins/default/gdrivesync.py @@ -7,6 +7,7 @@ import pwnagotchi import pydrive2 from pydrive2.auth import GoogleAuth from pydrive2.drive import GoogleDrive +from pwnagotchi.google import cmd as google_cmd class GdriveSync(plugins.Plugin): @@ -45,14 +46,8 @@ class GdriveSync(plugins.Plugin): try: gauth = GoogleAuth(settings_file="/root/settings.yaml") gauth.LoadCredentialsFile("/root/credentials.json") - if gauth.credentials is None: - # Authenticate if they're not there - gauth.LocalWebserverAuth() - elif gauth.access_token_expired: - # Refresh them if expired - gauth.Refresh() - gauth.SaveCredentialsFile("/root/credentials.json") gauth.Authorize() + gauth.SaveCredentialsFile("/root/credentials.json") # Create GoogleDrive instance self.drive = GoogleDrive(gauth)