Skip to content

Commit

Permalink
Fix: Delete OAuth credentials after successfully getting token (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
RikudouSage authored Sep 13, 2023
1 parent 59c865e commit e600ba5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ export class MastodonOauthCallbackComponent implements OnInit {
}
));
settings.oauthToken = response.access_token;
delete settings.oauthClientId;
delete settings.oauthClientSecret;
this.database.mastodonSynchronizationSettings = settings;
this.router.navigateByUrl('/synchronize/mastodon').then(() => {
this.messageService.createSuccess('Successfully logged in!');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class SynchronizeMastodonComponent implements OnInit {
public async ngOnInit(): Promise<void> {
this.titleService.title = 'Blacklist synchronization - Mastodon';

if (!this.syncSettings.oauthClientId || !this.syncSettings.oauthClientSecret) {
if (!this.syncSettings.oauthToken && (!this.syncSettings.oauthClientId || !this.syncSettings.oauthClientSecret)) {
this.oauthForm.patchValue({
clientId: this.syncSettings.oauthClientId ?? '',
secret: this.syncSettings.oauthClientSecret ?? '',
Expand Down

0 comments on commit e600ba5

Please sign in to comment.