feat: portal auth login and password reset
This commit is contained in:
@@ -20,3 +20,24 @@ export async function register({ username, password, confirmPassword, verifyCode
|
||||
if (token) await setTokenAndLoadMe(token);
|
||||
return token;
|
||||
}
|
||||
|
||||
export async function sendPasswordResetSms({ phone }) {
|
||||
return await requestJson('/v1/auth/password/reset/sms', {
|
||||
method: 'POST',
|
||||
body: { phone }
|
||||
});
|
||||
}
|
||||
|
||||
export async function verifyPasswordResetSms({ phone, code }) {
|
||||
return await requestJson('/v1/auth/password/reset/verify', {
|
||||
method: 'POST',
|
||||
body: { phone, code }
|
||||
});
|
||||
}
|
||||
|
||||
export async function resetPassword({ resetToken, password, confirmPassword }) {
|
||||
return await requestJson('/v1/auth/password/reset', {
|
||||
method: 'POST',
|
||||
body: { resetToken, password, confirmPassword }
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user