refactor(credentials): remove credential expiry support and API
The credential expiry feature has been removed from both the Rust backend and the frontend. Stored credentials now include only username and password. - Remove expiresAt field from StoredCredential - Simplify API by removing expiry param from credSave - Drop expiry UI and expiry checks across the app
This commit is contained in:
@@ -85,7 +85,7 @@
|
||||
const key = CRED_KEYS[target];
|
||||
const trimmed = value.trim();
|
||||
if (trimmed) {
|
||||
await credSave(key, "api-key", trimmed, null);
|
||||
await credSave(key, "api-key", trimmed);
|
||||
} else {
|
||||
await credDelete(key);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
action: "push" | "pull" | "fetch" | "clone";
|
||||
error: string;
|
||||
isBusy: boolean;
|
||||
onSubmit: (username: string, password: string, save: boolean, expiresAt: string | null) => void;
|
||||
onSubmit: (username: string, password: string, save: boolean) => void;
|
||||
onCancel: () => void;
|
||||
}
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
let password = $state("");
|
||||
let showPassword = $state(false);
|
||||
let saveSession = $state(true);
|
||||
let expiresAt = $state("");
|
||||
|
||||
let canSubmit = $derived(
|
||||
!isBusy &&
|
||||
@@ -62,12 +61,7 @@
|
||||
function handleSubmit(e: SubmitEvent) {
|
||||
e.preventDefault();
|
||||
if (!canSubmit) return;
|
||||
onSubmit(
|
||||
mode === "token" ? "oauth2" : username,
|
||||
password,
|
||||
saveSession,
|
||||
saveSession && expiresAt ? expiresAt : null,
|
||||
);
|
||||
onSubmit(mode === "token" ? "oauth2" : username, password, saveSession);
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -191,19 +185,6 @@
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if saveSession}
|
||||
<div class="cred-expiry">
|
||||
<label class="cred-field-label" for="cred-expiry">Expiration date (optional)</label>
|
||||
<input
|
||||
id="cred-expiry"
|
||||
type="date"
|
||||
bind:value={expiresAt}
|
||||
disabled={isBusy}
|
||||
/>
|
||||
<span class="cred-expiry-hint">After this date you'll automatically be asked to log in again.</span>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div class="cred-footer">
|
||||
<label class="cred-save">
|
||||
<input type="checkbox" bind:checked={saveSession} disabled={isBusy} />
|
||||
|
||||
Reference in New Issue
Block a user