fix(admin): console requests challenge with POST, matching the route

The SPA issued GET /admin/auth/challenge but the route is POST (nonce
issuance is a write). Left as-is the login flow 405'd at step one. Fixed
the client verb and rebuilt dist.
This commit is contained in:
jwinterm
2026-07-18 16:18:33 -04:00
parent d33a777556
commit e125f4fcc2
3 changed files with 5 additions and 3 deletions
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="robots" content="noindex" />
<title>Smirk Operator Console</title>
<script type="module" crossorigin src="/admin/assets/index-DLOlKNyc.js"></script>
<script type="module" crossorigin src="/admin/assets/index-4xN7Sa3G.js"></script>
<link rel="stylesheet" crossorigin href="/admin/assets/index-uKG4VNAS.css">
</head>
<body>
+3 -1
View File
@@ -56,7 +56,9 @@ export interface InviteView {
}
export const api = {
challenge: () => req('GET', '/admin/auth/challenge') as Promise<ChallengeResp>,
// POST (not GET): issuing a single-use nonce is a write, and must never be
// cached or prefetched. Matches the route wired in src/api/admin.rs.
challenge: () => req('POST', '/admin/auth/challenge', {}) as Promise<ChallengeResp>,
verify: (admin_token: string, challenge: string) =>
req('POST', '/admin/auth/verify', { admin_token, challenge }) as Promise<TokenResp>,
logout: () => req('POST', '/admin/auth/logout', {}),