MCPcopy Create free account
hub / github.com/PIKACHUIM/CFWorkerACME / loginUser

Function loginUser

frontend/src/api/auth.ts:59–66  ·  view source on GitHub ↗
(email: string, password: string)

Source from the content-addressed store, hash-verified

57 * 登录:返回 true 表示成功(后端会写入 Cookie)
58 */
59export async function loginUser(email: string, password: string): Promise<boolean> {
60 const nonce = await fetchLoginNonce(email);
61 const passHash = await sha256(password);
62 const passHmac = await hmac256(passHash, nonce);
63 const url = `/login/?email=${encodeURIComponent(email)}&token=${passHmac}`;
64 const res = await http.get<ApiResp>(url);
65 return res.status === 200 && (res.data.flags === 1 || res.data.flags === undefined);
66}
67
68/**
69 * 注册

Callers 1

handleLoginFunction · 0.90

Calls 3

sha256Function · 0.90
hmac256Function · 0.90
fetchLoginNonceFunction · 0.85

Tested by

no test coverage detected