mirror of
https://github.com/Such-Software/smirk-backend-core.git
synced 2026-10-25 18:28:55 +01:00
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:
+3
-1
@@ -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', {}),
|
||||
|
||||
Reference in New Issue
Block a user