mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
feat: register an account
This commit is contained in:
@@ -74,6 +74,7 @@ export interface Watchlist {
|
||||
export interface InstanceConfig {
|
||||
ssoLogin: boolean
|
||||
limtedFeatures: boolean
|
||||
registerEnabled: boolean
|
||||
}
|
||||
|
||||
export async function request<T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig): Promise<R> {
|
||||
|
||||
@@ -10,6 +10,16 @@ export async function login(email: string, password: string): Promise<boolean> {
|
||||
return response.status === 200
|
||||
}
|
||||
|
||||
export async function register(email: string, password: string): Promise<boolean> {
|
||||
const response = await request({
|
||||
method: 'POST',
|
||||
url: 'register',
|
||||
data: {email, password}
|
||||
})
|
||||
return response.status === 201
|
||||
}
|
||||
|
||||
|
||||
export async function getUser(): Promise<User> {
|
||||
const response = await request<User>({
|
||||
url: 'me'
|
||||
|
||||
Reference in New Issue
Block a user