MCPcopy Create free account
hub / github.com/OpenSIST/OpenSIST.github.io / login

Function login

src/Data/UserData.js:53–66  ·  view source on GitHub ↗
(email, password)

Source from the content-addressed store, hash-verified

51}
52
53export async function login(email, password) {
54 const username = email.split('@')[0];
55 const response = await authRequest(LOGIN, {email, password});
56 if (response.status !== 200) {
57 const content = await response.json();
58 alert(`${content.error}, Error code: ${response.status}`)
59 return redirect("/login");
60 }
61 const userInfo = {
62 user: username
63 }
64 await setUserInfo(userInfo);
65 return redirect("/");
66}
67
68export async function registerReset(email, password, token, status) {
69 const api = status === 'reset' ? RESET_PASSWORD : REGISTER;

Callers 1

actionFunction · 0.90

Calls 2

authRequestFunction · 0.85
setUserInfoFunction · 0.85

Tested by

no test coverage detected