0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-02-17 22:04:19 -05:00

refactor(cli): remove default case

This commit is contained in:
Gao Sun 2022-11-07 11:53:02 +08:00
parent 682c88aac8
commit cf2c546f5d
No known key found for this signature in database
GPG key ID: 13EBE123E4773688

View file

@ -137,15 +137,13 @@ const rotateConfig: CommandModule<unknown, { key: string }> = {
const parsed = logtoConfigGuards[key].safeParse(rows[0]?.value);
const original = parsed.success ? parsed.data : [];
// No need for default. It's already exhaustive
// eslint-disable-next-line default-case
switch (key) {
case LogtoOidcConfigKey.PrivateKeys:
return [await generateOidcPrivateKey(), ...original];
case LogtoOidcConfigKey.CookieKeys:
return [generateOidcCookieKey(), ...original];
default:
log.warn('No proper handler found, use empty array');
return [];
}
};
const rotated = await getValue();