mirror of
https://github.com/abraunegg/onedrive
synced 2024-04-26 11:30:40 +02:00
Do not re-auth on --logout (#1705)
* When issuing a --logout, do not perform a reauthentication of the application
This commit is contained in:
parent
6febb13408
commit
cceb3cccdd
23
src/main.d
23
src/main.d
|
@ -498,21 +498,26 @@ int main(string[] args)
|
|||
cfg.setValueBool("resync", true);
|
||||
}
|
||||
|
||||
// Handle --resync and --logout to remove local files
|
||||
if (cfg.getValueBool("resync") || cfg.getValueBool("logout")) {
|
||||
// Handle --logout as separate item, do not 'resync' on a --logout / reauth
|
||||
if (cfg.getValueBool("logout")) {
|
||||
log.vdebug("--logout requested");
|
||||
log.log("Deleting the saved authentication status ...");
|
||||
if (!cfg.getValueBool("dry_run")) {
|
||||
safeRemove(cfg.refreshTokenFilePath);
|
||||
}
|
||||
// Exit
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
// Handle --resync to remove local files
|
||||
if (cfg.getValueBool("resync")) {
|
||||
if (cfg.getValueBool("resync")) log.vdebug("--resync requested");
|
||||
log.vlog("Deleting the saved status ...");
|
||||
log.log("Deleting the saved application sync status ...");
|
||||
if (!cfg.getValueBool("dry_run")) {
|
||||
safeRemove(cfg.databaseFilePath);
|
||||
safeRemove(cfg.deltaLinkFilePath);
|
||||
safeRemove(cfg.uploadStateFilePath);
|
||||
}
|
||||
if (cfg.getValueBool("logout")) {
|
||||
log.vdebug("--logout requested");
|
||||
if (!cfg.getValueBool("dry_run")) {
|
||||
safeRemove(cfg.refreshTokenFilePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Display current application configuration, no application initialisation
|
||||
|
|
Loading…
Reference in a new issue