mirror of
https://github.com/nicotsx/ironmount.git
synced 2025-12-10 12:10:51 +01:00
feat: auth client middleware
This commit is contained in:
@@ -68,6 +68,10 @@ export const register = <ThrowOnError extends boolean = false>(options?: Options
|
||||
return (options?.client ?? _heyApiClient).post<RegisterResponses, RegisterErrors, ThrowOnError>({
|
||||
url: "/api/v1/auth/register",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
@@ -78,6 +82,10 @@ export const login = <ThrowOnError extends boolean = false>(options?: Options<Lo
|
||||
return (options?.client ?? _heyApiClient).post<LoginResponses, LoginErrors, ThrowOnError>({
|
||||
url: "/api/v1/auth/login",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type RegisterData = {
|
||||
body?: never;
|
||||
body?: {
|
||||
password: string;
|
||||
username: string;
|
||||
};
|
||||
path?: never;
|
||||
query?: never;
|
||||
url: "/api/v1/auth/register";
|
||||
@@ -30,7 +33,10 @@ export type RegisterResponses = {
|
||||
export type RegisterResponse = RegisterResponses[keyof RegisterResponses];
|
||||
|
||||
export type LoginData = {
|
||||
body?: never;
|
||||
body?: {
|
||||
password: string;
|
||||
username: string;
|
||||
};
|
||||
path?: never;
|
||||
query?: never;
|
||||
url: "/api/v1/auth/login";
|
||||
|
||||
Reference in New Issue
Block a user