refactor(ui): move personal tokens and instance authentication out of Access

Personal API tokens are the signed-in operator's, and the instance URL and
OIDC providers are the instance's, so neither belongs under the organisation
Access area. Tokens render in the account page and Authentication moves to
Settings; the old paths redirect.
This commit is contained in:
sam committed 2026-10-17 02:41:24 +11:00
1 parent 5b10140a36
commit 195644ed03
18 files changed
+118 -127

No files matched your search

+4 -2
View File
@@ -1,6 +1,7 @@
<script setup lang="ts">
import { computed, onMounted, ref } from "vue";
import PageHeader from "@/base/PageHeader.vue";
import PersonalTokensCard from "@/accounts/PersonalTokensCard.vue";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { api } from "@/lib/api";
@@ -20,15 +21,16 @@ const change=()=>run(async()=>{await api.changePassword(current.value,next.value
<div class="max-w-2xl space-y-6">
<PageHeader title="Your account" />
<p class="text-sm">{{accounts.status?.user?.display_name}}</p>
<p v-if="$route.query.welcome" class="rounded-lg border border-border bg-card p-4 text-sm">Your organisation and admin account are ready. Add a passkey below, <RouterLink class="underline" to="/access">add accounts</RouterLink>, or <RouterLink class="underline" to="/access/authentication">configure OIDC</RouterLink>.</p>
<p v-if="$route.query.welcome" class="rounded-lg border border-border bg-card p-4 text-sm">Your organisation and admin account are ready. Add a passkey below, <RouterLink class="underline" to="/access">add accounts</RouterLink>, or <RouterLink class="underline" to="/settings/authentication">configure OIDC</RouterLink>.</p>
<p v-if="error" role="alert" class="text-sm text-danger">{{error}} <a class="underline" href="/?reauth=1">Sign in again</a></p>
<section class="rounded-lg border border-border bg-card p-5">
<h2 class="font-medium">Passkeys</h2>
<p class="mt-1 text-sm text-muted-foreground">Sign in with your device or security key.</p>
<ul class="mt-4 divide-y divide-border"><li v-for="key in keys" :key="key.id" class="flex items-center gap-3 py-2 text-sm"><span class="min-w-0 flex-1 truncate">{{key.name}}</span><Button variant="ghost" size="sm" :disabled="busy" @click="remove(key.id)">Remove</Button></li></ul>
<form v-if="eligible" class="mt-3 flex flex-wrap gap-2" @submit.prevent="enroll"><Input v-model="keyName" aria-label="Passkey name" placeholder="Passkey name (optional)" maxlength="200" class="min-w-40 flex-1"/><Button type="submit" :disabled="busy">Add passkey</Button></form>
<p v-else class="mt-3 text-sm text-muted-foreground">Open Archie at its configured HTTPS domain, or localhost, in a browser that supports passkeys. The instance URL is managed in <RouterLink class="underline" to="/access/authentication">Authentication settings</RouterLink>.</p>
<p v-else class="mt-3 text-sm text-muted-foreground">Open Archie at its configured HTTPS domain, or localhost, in a browser that supports passkeys. The instance URL is managed in <RouterLink class="underline" to="/settings/authentication">Authentication settings</RouterLink>.</p>
</section>
<PersonalTokensCard />
<section class="rounded-lg border border-border bg-card p-5 space-y-3">
<h2 class="font-medium">Recovery code</h2>
<p class="text-sm text-muted-foreground">Save this once-only code somewhere safe. It resets your password if you lose access. Generating a new code replaces the previous one.</p>
@@ -60,9 +60,9 @@ onMounted(load);
</script>
<template>
<section class="mb-8" aria-labelledby="personal-tokens">
<section class="rounded-lg border border-border bg-card p-5" aria-labelledby="personal-tokens">
<div class="mb-3 flex items-center justify-between gap-2">
<h2 id="personal-tokens" class="text-sm font-medium">API tokens</h2>
<h2 id="personal-tokens" class="font-medium">API tokens</h2>
<Button v-if="available" size="sm" :disabled="busy" @click="create"><Plus data-icon="inline-start" />New token</Button>
</div>
<p v-if="!available && !busy && !error" class="mb-3 text-sm text-fg-subtle">Personal tokens need a signed-in person.</p>
+1 -1
View File
@@ -86,7 +86,7 @@ const settings: NavSpec = {
// Reached from the Dashboard's Logs button and the account menu, and by
// Jump to, but not from the bar.
const unlisted = ["/logs", "/account", "/access/policies", "/access/tokens", "/access/authentication", "/access/agents", "/access/workspaces", "/access/models"];
const unlisted = ["/logs", "/account", "/settings/authentication", "/access/policies", "/access/agents", "/access/workspaces", "/access/models"];
/** hiddenPaths lists the routes this composition cannot back. */
export function hiddenPaths(sections: CapabilitySections | null): string[] {
+3 -6
View File
@@ -18,8 +18,6 @@ import { useOrgStore } from "@/stores/org";
const TABS = [
{ path: "/access", label: "Accounts" },
{ path: "/access/policies", label: "Policies", home: true },
{ path: "/access/tokens", label: "Tokens", home: true },
{ path: "/access/authentication", label: "Authentication", home: true, admin: true },
{ path: "/access/agents", label: "Agents" },
{ path: "/access/workspaces", label: "Workspaces" },
{ path: "/access/models", label: "Models", home: true, member: true },
@@ -30,13 +28,12 @@ const router = useRouter();
const orgStore = useOrgStore();
const { homeOrg, instanceAdmin, org, orgs } = storeToRefs(orgStore);
// Policies and tokens act on the caller's own org server-side, so they are
// hidden while an instance admin views another org rather than editing the
// wrong one.
// Policies act on the caller's own org server-side, so they are hidden while
// an instance admin views another org rather than editing the wrong one.
const away = computed(() => !!org.value && org.value.id !== homeOrg.value);
// Models is an org's own; the system org configures models in Settings.
const tabs = computed(() =>
TABS.filter((tab) => !(tab.admin && !instanceAdmin.value) && !(away.value && tab.home) && !(tab.member && homeOrg.value === "org-sys")),
TABS.filter((tab) => !(away.value && tab.home) && !(tab.member && homeOrg.value === "org-sys")),
);
watch([away, () => route.path], ([isAway]) => {
if (isAway && TABS.some((tab) => tab.home && route.path.startsWith(tab.path))) {
-9
View File
@@ -1,9 +0,0 @@
<script setup lang="ts">
import PersonalTokensCard from "@/settings/PersonalTokensCard.vue";
</script>
<template>
<div>
<PersonalTokensCard />
</div>
</template>
+16 -16
View File
@@ -10,7 +10,6 @@ import OrgMembersPage from "@/org/OrgMembersPage.vue";
import OrgAgentsPage from "@/org/OrgAgentsPage.vue";
import OrgWorkspacesPage from "@/org/OrgWorkspacesPage.vue";
import OrgAccessPage from "@/org/OrgAccessPage.vue";
import OrgTokensPage from "@/org/OrgTokensPage.vue";
import OrgModelsPage from "@/org/OrgModelsPage.vue";
import SchedulingPolicyPage from "@/settings/SchedulingPolicyPage.vue";
import ReviewSettingsPage from "@/settings/ReviewSettingsPage.vue";
@@ -42,7 +41,8 @@ import WorkflowsPage from "@/workflows/WorkflowsPage.vue";
// navPath the navigation entry this route keeps current
const routes = [
{path:"/account",name:"account",component:()=>import("@/accounts/AccountPage.vue"),meta:{label:"Your account"}},
{path:"/settings/authentication",redirect:"/access/authentication",meta:{nav:false}},
{path:"/access/authentication",redirect:"/settings/authentication",meta:{nav:false}},
{path:"/access/tokens",redirect:"/account",meta:{nav:false}},
{
path: "/",
name: "dashboard",
@@ -169,6 +169,18 @@ const routes = [
section: "settings",
},
},
{
path: "/settings/authentication",
name: "authentication",
component: () => import("@/accounts/AuthenticationPage.vue"),
meta: {
navPath: "/settings",
settings: true,
label: "Authentication",
description: "Instance URL and single sign-on providers.",
section: "settings",
},
},
{
path: "/settings/repositories",
name: "system-repos",
@@ -187,16 +199,10 @@ const routes = [
component: AccessPage,
meta: {
label: "Access",
description: "Accounts, policies, tokens, authentication and organisation access.",
description: "Organisation members, execution identities, workspaces and policies.",
navPath: "/access",
},
children: [
{
path: "/access/authentication",
name: "authentication",
component: () => import("@/accounts/AuthenticationPage.vue"),
meta: { label: "Authentication", navPath: "/access" },
},
{
path: "",
name: "access-members",
@@ -221,12 +227,6 @@ const routes = [
component: OrgAccessPage,
meta: { label: "Policies", navPath: "/access" },
},
{
path: "/access/tokens",
name: "access-tokens",
component: OrgTokensPage,
meta: { label: "Tokens", navPath: "/access" },
},
{
path: "/access/models",
name: "access-models",
@@ -243,7 +243,7 @@ const routes = [
"/org/agents": "/access/agents",
"/org/workspaces": "/access/workspaces",
"/org/access": "/access/policies",
"/org/tokens": "/access/tokens",
"/org/tokens": "/account",
"/org/models": "/access/models",
}).map(([path, redirect]) => ({ path, redirect, meta: { nav: false } })),
{