| 66 | } |
| 67 | |
| 68 | export async function registerReset(email, password, token, status) { |
| 69 | const api = status === 'reset' ? RESET_PASSWORD : REGISTER; |
| 70 | const response = await authRequest(api, {email, password, token}); |
| 71 | |
| 72 | if (response.status === 200) { |
| 73 | return redirect("/login"); |
| 74 | } |
| 75 | const content = await response.json(); |
| 76 | const path = status === 'reset' ? '/reset' : '/register'; |
| 77 | alert(`${content.error}, Error code: ${response.status}`); |
| 78 | return redirect(path); |
| 79 | } |
| 80 | |
| 81 | export async function setUserInfo(userInfo) { |
| 82 | if (!userInfo) { |