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

Function registerUser

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

Source from the content-addressed store, hash-verified

69 * 注册
70 */
71export async function registerUser(
72 email: string,
73 password: string,
74 code: string,
75): Promise<boolean> {
76 const passHash = await sha256(password);
77 const codeHash = await sha256(code);
78 const mailCode = await hmac256(email, codeHash);
79 const passCode = await aes256(passHash, codeHash);
80 const url = `/setup/?email=${encodeURIComponent(email)}&codes=${mailCode}&crypt=${passCode}`;
81 const res = await http.get<ApiResp>(url);
82 return res.status === 200;
83}
84
85/**
86 * 重置密码

Callers 2

handleRegisterFunction · 0.90
resetPasswordFunction · 0.85

Calls 3

sha256Function · 0.90
hmac256Function · 0.90
aes256Function · 0.90

Tested by

no test coverage detected