Use Keycloak OAuth for a2amcp login
This commit is contained in:
19
src/api.ts
19
src/api.ts
@@ -1,7 +1,4 @@
|
||||
/**
|
||||
* Thin control-plane client. Mirrors the relevant subset of
|
||||
* a2a_pack.cli.api_client.ControlPlaneClient.
|
||||
*/
|
||||
/** Thin control-plane client used with Keycloak bearer tokens. */
|
||||
export class ApiError extends Error {
|
||||
constructor(public status: number, message: string) {
|
||||
super(`API ${status}: ${message}`);
|
||||
@@ -52,20 +49,6 @@ export class ControlPlaneClient {
|
||||
return (await resp.json()) as T;
|
||||
}
|
||||
|
||||
login(email: string, password: string) {
|
||||
return this.request<{
|
||||
access_token: string;
|
||||
user: { id: number; email: string };
|
||||
}>("POST", "/v1/auth/login", { email, password });
|
||||
}
|
||||
|
||||
signup(email: string, password: string) {
|
||||
return this.request<{
|
||||
access_token: string;
|
||||
user: { id: number; email: string };
|
||||
}>("POST", "/v1/auth/signup", { email, password });
|
||||
}
|
||||
|
||||
me() {
|
||||
return this.request<{ id: number; email: string }>("GET", "/v1/me");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user