<< All versions
Skill v1.0.0
currentLLM-judged scan90/100mmtaee/ocserv-dashboard/dashboard-auth-bootstrap
──Details
PublishedOctober 23, 2026 at 12:38 AM
Content Hashsha256:2a1c02a008353adf...
Git SHA5690d08c08ae
──Files
Files (1 file, 2.7 KB)
SKILL.md2.7 KBactive
SKILL.md · 28 lines · 2.7 KB
version: "1.0.0" name: dashboard-auth-bootstrap description: Maintain the pre-mount system initialization and authentication flow in this Vue admin dashboard. Use when changing main.ts startup, system-init Pinia state, auth/setup routes, generated system API wrappers, login/setup forms, or captcha gating.
Dashboard Auth Bootstrap
Preserve these startup invariants:
- Call
GET /system/initbefore mounting Vue and store its raw response in the Pinia system-init store. - Treat a request failure as unavailable and route to the server-unavailable view before making authentication or initialization routing decisions.
- When the server is available, validate the stored access token with the generated profile API. Route unauthenticated users to
login-02regardless offirst_init. - After login stores a new token, call
GET /system/users/profileand save that canonical response in the auth store. Do not use an embedded login-response user as the stored profile. - When
/loginis requested with a stored token, validate it through the profile API. Redirect a valid session home; clear an invalid session and remain on login. - Handle every API
401in the shared Axios response interceptor: clear the token and auth-store user, then redirect to login. Register router/store behavior through a callback so the API client does not import application routing. - Only after authentication succeeds, read
first_initfrom the system-init store. Routefirst_init !== trueto thesignup-02system configuration view andfirst_init === truehome. - After login, availability retry, or setup submission, preserve the same availability → authentication → first-init routing order. After a successful setup update, merge the
PATCH /systemresponse into the system-init store; do not callGET /system/initagain. - Pass
requireAuthorizationHeader()to generated system endpoints that require an explicit authorization parameter. The shared Axios interceptor adds the current bearer token to other system requests whenever a token exists. - Render the captcha atom only when
google_captcha_site_keyis non-empty and submit its token through the login schema'stokenfield.
Keep generated files in src/api/generated read-only. Put API behavior in src/api/services, state in src/stores, routed screens in src/views, and reusable UI in src/components. Type forms from generated request schemas and validate changes with yarn type-check and yarn build.
Naming
- Never use
OCServin user-facing text or project-authored identifiers. UseOcservfor names and titles, andocservfor lowercase identifiers, commands, paths, and configuration keys. - Do not rename generated OpenAPI symbols; their spelling is controlled by the backend schema.