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
+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', {}),