mcp key
This commit is contained in:
@@ -4,6 +4,8 @@ import { Observable, finalize, shareReplay, tap, throwError } from 'rxjs';
|
||||
import {
|
||||
AuthTokenResponse,
|
||||
LoginRequest,
|
||||
McpApiKeyResponse,
|
||||
McpApiKeyStatus,
|
||||
PublicUser,
|
||||
PublicUserSearchResult,
|
||||
RegisterRequest,
|
||||
@@ -42,16 +44,13 @@ export class AuthService {
|
||||
}
|
||||
|
||||
resendVerificationEmail(email: string): Observable<ResendVerificationResponse> {
|
||||
return this.http.post<ResendVerificationResponse>(
|
||||
`${this.apiUrl}/resend-verification`,
|
||||
{ email },
|
||||
);
|
||||
return this.http.post<ResendVerificationResponse>(`${this.apiUrl}/resend-verification`, {
|
||||
email,
|
||||
});
|
||||
}
|
||||
|
||||
loadCurrentUser(): Observable<PublicUser> {
|
||||
return this.http
|
||||
.get<PublicUser>(`${this.apiUrl}/me`)
|
||||
.pipe(tap((user) => this.storeUser(user)));
|
||||
return this.http.get<PublicUser>(`${this.apiUrl}/me`).pipe(tap((user) => this.storeUser(user)));
|
||||
}
|
||||
|
||||
searchUsers(query: string): Observable<PublicUserSearchResult[]> {
|
||||
@@ -67,6 +66,18 @@ export class AuthService {
|
||||
.pipe(tap((user) => this.storeUser(user)));
|
||||
}
|
||||
|
||||
getMcpApiKeyStatus(): Observable<McpApiKeyStatus> {
|
||||
return this.http.get<McpApiKeyStatus>(`${this.apiUrl}/me/mcp-api-key`);
|
||||
}
|
||||
|
||||
createMcpApiKey(): Observable<McpApiKeyResponse> {
|
||||
return this.http.post<McpApiKeyResponse>(`${this.apiUrl}/me/mcp-api-key`, {});
|
||||
}
|
||||
|
||||
revokeMcpApiKey(): Observable<McpApiKeyStatus> {
|
||||
return this.http.delete<McpApiKeyStatus>(`${this.apiUrl}/me/mcp-api-key`);
|
||||
}
|
||||
|
||||
accessToken(): string | null {
|
||||
return this.storage?.getItem(ACCESS_TOKEN_KEY) ?? null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user