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

Function changePassword

frontend/src/api/auth.ts:99–109  ·  view source on GitHub ↗
(
  email: string,
  oldPassword: string,
  newPassword: string,
)

Source from the content-addressed store, hash-verified

97 * 修改密码(登录态下)
98 */
99export async function changePassword(
100 email: string,
101 oldPassword: string,
102 newPassword: string,
103): Promise<boolean> {
104 const oldHash = await sha256(oldPassword);
105 const newHash = await sha256(newPassword);
106 const url = `/setup/?email=${encodeURIComponent(email)}&crypt=${newHash}&pass=${oldHash}`;
107 const res = await http.get<ApiResp>(url);
108 return res.status === 200;
109}
110
111/**
112 * 检查登录状态

Callers

nothing calls this directly

Calls 1

sha256Function · 0.90

Tested by

no test coverage detected