FInished password reset (hopefully)
This commit is contained in:
@ -39,3 +39,15 @@ export async function resetPassword(email: string) {
|
||||
return { error: error.response.data.message }
|
||||
}
|
||||
}
|
||||
|
||||
export async function newPassword(urlToken: string, password: string) {
|
||||
try {
|
||||
const response = await axios.post(`${config.server_endpoint}/new-password`, { urlToken, password })
|
||||
return { success: true, token: response.data.token }
|
||||
} catch (error: any) {
|
||||
if (typeof error.response.data === 'undefined') {
|
||||
return { error: 'Could not connect to server' }
|
||||
}
|
||||
return { error: error.response.data.message }
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user