diff --git a/svelte/src/lib/NovaAPI.ts b/svelte/src/lib/NovaAPI.ts
index 10214f3..2db0d88 100644
--- a/svelte/src/lib/NovaAPI.ts
+++ b/svelte/src/lib/NovaAPI.ts
@@ -95,6 +95,22 @@ export type UserSession = {
creation_time: string,
last_used_time: string,
valid_domains: string[],
+
+ // Whether this is the key the list of sessions was requested with
+ current: boolean,
+
+ // What the key is allowed to do
+ filesystem_read: boolean,
+ filesystem_write: boolean,
+ account_read: boolean,
+ account_write: boolean,
+ session_read: boolean,
+ session_write: boolean,
+ billing_read: boolean,
+ billing_write: boolean,
+
+ // IDs of the directories the key is limited to. Empty means no limit
+ filesystem_dirs: string[],
}
// If cached_user is undefined it means that the value is not initialized yet,
diff --git a/svelte/src/user_home/APIKeys.svelte b/svelte/src/user_home/APIKeys.svelte
index 9dcab33..45df620 100644
--- a/svelte/src/user_home/APIKeys.svelte
+++ b/svelte/src/user_home/APIKeys.svelte
@@ -1,187 +1,327 @@
-
- API keys are sensitive information. They can be used to gain
- full control over your account. Do not show your API keys to
- someone or something you don't trust!
-
- If you delete the API key that you are currently using you will be
- logged out of your account. Keys are sorted based on how recently they
- were used, so your session usually the top one. API keys expire 30 days
- after the last time they're used. If you think someone is using your
- account without your authorization it's probably a good idea to delete
- all your keys.
+ API keys give apps access to your account. Whoever has a key can do
+ everything the key is allowed to do, so don't show them to someone or
+ something you don't trust. A key expires 30 days after it was last used.
+ If you think someone is using your account without your permission,
+ delete all your keys and change your password.
Warning
-
| Key | -Created | -Last used ▼ | -IP address | -- |
|
- |
- {formatDate(row.creation_time, true, true, false)} | -{formatDate(row.last_used_time, true, true, false)} | -{row.creation_ip_address} | -- - | -
- {#if row.app_name === "website login"}
-
- ShareX
- {:else if row.app_name === "jdownloader"}
-
- JDownloader
+
+
+
+ {#each keys as key (key.auth_key)}
+
+
+
+ {#if key.app_name === "website login"}
+
+
+ ShareX
+ {:else if key.app_name === "jdownloader"}
+ JDownloader
+ {:else}
+ apps {key.app_name || "Unnamed key"}
+ {/if}
+
+ {#if key.current}
+ This session
+ {/if}
+
+
+
+
+
+
+ {shown[key.auth_key] ? key.auth_key : key.auth_key.slice(0, 8) + "-••••-••••-••••-••••••••••••"}
+
+
+ |
- User-Agent: {row.user_agent} | -|||