Better data key for window

This commit is contained in:
Gregory Schier
2025-02-24 22:34:10 -08:00
parent 52937c3097
commit c0dbe46318
5 changed files with 37 additions and 9 deletions

View File

@@ -9,7 +9,7 @@ import { DEFAULT_PKCE_METHOD, getAuthorizationCode, PKCE_PLAIN, PKCE_SHA256 } fr
import { getClientCredentials } from './grants/clientCredentials';
import { getImplicit } from './grants/implicit';
import { getPassword } from './grants/password';
import { AccessToken, deleteToken, getToken } from './store';
import { AccessToken, deleteToken, getToken, resetDataDirKey } from './store';
type GrantType = 'authorization_code' | 'implicit' | 'password' | 'client_credentials';
@@ -71,7 +71,6 @@ export const plugin: PluginDefinition = {
actions: [
{
label: 'Copy Current Token',
icon: 'copy',
async onSelect(ctx, { contextId }) {
const token = await getToken(ctx, contextId);
if (token == null) {
@@ -84,7 +83,6 @@ export const plugin: PluginDefinition = {
},
{
label: 'Delete Token',
icon: 'trash',
async onSelect(ctx, { contextId }) {
if (await deleteToken(ctx, contextId)) {
await ctx.toast.show({ message: 'Token deleted', color: 'success' });
@@ -93,6 +91,12 @@ export const plugin: PluginDefinition = {
}
},
},
{
label: 'Clear Window Session',
async onSelect(ctx, { contextId }) {
await resetDataDirKey(ctx, contextId);
},
},
],
args: [
{