Also return expiration
This commit is contained in:
parent
8cfcb72f0c
commit
9458607435
@ -19,5 +19,5 @@ export async function getToken() {
|
||||
headers: {'Content-Type': 'application/json'}
|
||||
});
|
||||
const data = await response.json();
|
||||
return data.access_token;
|
||||
return [data.access_token, data.expires_in];
|
||||
}
|
@ -21,7 +21,7 @@ const rl = readline.createInterface({
|
||||
do {
|
||||
const response = await fetch(`https://photoslibrary.googleapis.com/v1/albums?pageSize=50${nextPageToken ? `&${nextPageToken}`: ""}`, {
|
||||
headers: {
|
||||
Authorization: `Bearer ${await getToken()}`,
|
||||
Authorization: `Bearer ${(await getToken())[0]}`,
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user