Skip to content

Commit

Permalink
Fix authentication flow in handleGoogleLogin function and Add a link …
Browse files Browse the repository at this point in the history
…button to Google Dev console.
  • Loading branch information
zzunebye committed Aug 17, 2024
1 parent b82549a commit 86a5024
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,10 @@ export async function handleGoogleLogin(
setRefreshToken(token.refresh_token);
setAccessToken(token.access_token);
setAccessTokenExpirationTime(+new Date() + token.expires_in * 1000);
onSuccess();
}
}

new Notice("Tokens acquired.");

onSuccess();

res.end("Authentication successful! Please return to Obsidian.");

Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default class GoogleLikedVideoPlugin extends Plugin {

this.addCommand({
id: 'open-liked-video-list-view',
name: 'Open Youtube Liked Video List View',
name: 'Open Geulo (Youtube Liked Video) List View',
callback: () => {
this.activateView();
}
Expand Down
8 changes: 8 additions & 0 deletions src/views/GoogleLikedVideoSettingTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ export class GoogleLikedVideoSettingTab extends PluginSettingTab {
.setName('Setup')
.setDesc('Setup the plugin');

new Setting(containerEl)
.setName('Open Youtube Data API Console')
.setDesc('Click the button below to open the Google Developer Console, where you can manage your Google APIs and credentials.')
.addButton(button => button
.setButtonText('Open Google Developer Console')
.onClick(async () => {
window.open('https://console.cloud.google.com/apis/api/youtube.googleapis.com', '_blank');
}));

new Setting(containerEl)
.setName('Client ID')
Expand Down

0 comments on commit 86a5024

Please sign in to comment.