feat(auth): add registration page
This commit is contained in:
@ -22,6 +22,12 @@ export interface LoginRequest {
|
||||
email: string;
|
||||
password: string;
|
||||
}
|
||||
export interface RegistrationRequest {
|
||||
email: string;
|
||||
name: string;
|
||||
avatar_url: string;
|
||||
password: string;
|
||||
}
|
||||
|
||||
export interface User {
|
||||
email: string;
|
||||
@ -96,6 +102,14 @@ class ApiClient {
|
||||
body: JSON.stringify(credentials),
|
||||
});
|
||||
}
|
||||
async register(
|
||||
credentials: RegistrationRequest,
|
||||
): Promise<{ message: string }> {
|
||||
return this.request<{ message: string }>("/auth/register/", {
|
||||
method: "POST",
|
||||
body: JSON.stringify(credentials),
|
||||
});
|
||||
}
|
||||
|
||||
// Authenticated request helper
|
||||
async authenticatedRequest<T>(
|
||||
|
||||
Reference in New Issue
Block a user