Skip to content

Commit f74fb06

Browse files
author
Corentin Mors
authored
Option to skip device revocation on logout (#221)
Allow to clear local storage without revoking the device on the server side.
1 parent d71249b commit f74fb06

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/command-handlers/logout.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ import { connectAndPrepare, connect, reset } from '../modules/database';
55
import { LocalConfiguration, DeviceConfiguration } from '../types';
66
import { askConfirmReset } from '../utils';
77

8-
export const runLogout = async () => {
8+
export const runLogout = async (options: { ignoreRevocation: boolean }) => {
9+
if (options.ignoreRevocation) {
10+
winston.info("The device credentials won't be revoked on Dashlane's servers");
11+
}
12+
913
const resetConfirmation = await askConfirmReset();
1014
if (!resetConfirmation) {
1115
return;
@@ -29,7 +33,7 @@ export const runLogout = async () => {
2933
db = connect();
3034
db.serialize();
3135
}
32-
if (localConfiguration && deviceConfiguration) {
36+
if (localConfiguration && deviceConfiguration && !options.ignoreRevocation) {
3337
await deactivateDevices({
3438
deviceIds: [deviceConfiguration.accessKey],
3539
login: deviceConfiguration.login,

src/commands/index.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -112,5 +112,9 @@ export const rootCommands = (params: { program: Command }) => {
112112
.description('Backup your local vault (will use the current directory by default)')
113113
.action(runBackup);
114114

115-
program.command('logout').description('Logout and clean your local database and OS keychain').action(runLogout);
115+
program
116+
.command('logout')
117+
.option('--ignore-revocation', "Device credentials won't be revoked on Dashlane's servers")
118+
.description('Logout and clean your local database and OS keychain')
119+
.action(runLogout);
116120
};

0 commit comments

Comments
 (0)