Added new API key and using API key config items to enable a public API

API key config items are implemented UI-side

Added ability to generate API keys through the settings

Switched getmp3s and getmp4s api calls to be GET requests rather than POST

Removed unused code from settings dialog
This commit is contained in:
Isaac Grynsztein
2020-04-10 14:46:36 -04:00
parent 02441ac846
commit 1e96e31053
9 changed files with 75 additions and 43 deletions

View File

@@ -86,6 +86,15 @@ export class SettingsComponent implements OnInit {
});
}
generateAPIKey() {
this.postsService.generateNewAPIKey().subscribe(res => {
if (res['new_api_key']) {
this.initial_config.API.API_key = res['new_api_key'];
this.new_config.API.API_key = res['new_api_key'];
}
});
}
localeSelectChanged(new_val) {
localStorage.setItem('locale', new_val);
this.openSnackBar('Language successfully changed! Reload to update the page.')