mirror of
https://github.com/Nezumi-2711/next-gdrive-index.git
synced 2026-09-22 20:01:36 +00:00
Testing and update about error
This commit is contained in:
@@ -20,6 +20,14 @@ class DriveClient {
|
||||
);
|
||||
oauth2Client.setCredentials({ refresh_token: this.decryptedRefreshToken });
|
||||
this.instance = google.drive({ version: "v3", auth: oauth2Client });
|
||||
oauth2Client.on("tokens", (tokens) => {
|
||||
if (tokens.refresh_token) {
|
||||
console.log("Refresh: ", tokens.refresh_token);
|
||||
}
|
||||
if (tokens.access_token) {
|
||||
console.log("Access: ", tokens.access_token);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
getInstance() {
|
||||
@@ -32,6 +40,7 @@ class DriveClient {
|
||||
refresh_token: process.env.REFRESH_TOKEN,
|
||||
});
|
||||
this.instance = google.drive({ version: "v3", auth: oauth2Client });
|
||||
console.log(oauth2Client.credentials.access_token);
|
||||
}
|
||||
return this.instance;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user