Check reset token validity
This commit is contained in:
@ -1,6 +1,10 @@
|
||||
import { atom } from "jotai";
|
||||
import { APIClient } from "./ApiClient";
|
||||
|
||||
export interface CheckResetTokenResponse {
|
||||
name: string;
|
||||
}
|
||||
|
||||
const TokenStateKey = "auth-token";
|
||||
|
||||
export class AuthApi {
|
||||
@ -73,4 +77,19 @@ export class AuthApi {
|
||||
jsonData: { mail: mail },
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Check reset password token
|
||||
*/
|
||||
static async CheckResetPasswordToken(
|
||||
token: string
|
||||
): Promise<CheckResetTokenResponse> {
|
||||
return (
|
||||
await APIClient.exec({
|
||||
uri: "/auth/check_reset_password_token",
|
||||
method: "POST",
|
||||
jsonData: { token: token },
|
||||
})
|
||||
).data;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user