Skip to content

Commit

Permalink
fix: gavatar use sha256 for hash
Browse files Browse the repository at this point in the history
  • Loading branch information
shuashuai committed Aug 6, 2024
1 parent 11fb3aa commit c3a1704
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 26 deletions.
2 changes: 1 addition & 1 deletion ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
"diff": "^5.1.0",
"front-matter": "^4.0.2",
"i18next": "^21.9.0",
"js-sha256": "0.11.0",
"lodash": "^4.17.21",
"marked": "^4.0.19",
"md5": "^2.3.0",
"next-share": "^0.18.1",
"qrcode": "^1.5.1",
"qs": "^6.11.0",
Expand Down
30 changes: 7 additions & 23 deletions ui/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions ui/src/pages/Users/Settings/Profile/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import React, { FormEvent, useState, useEffect } from 'react';
import { Form, Button, Stack, ButtonGroup } from 'react-bootstrap';
import { Trans, useTranslation } from 'react-i18next';

import MD5 from 'md5';
import { sha256 } from 'js-sha256';

import type { FormDataType } from '@/common/interface';
import { UploadImg, Avatar, Icon, ImgViewer } from '@/components';
Expand Down Expand Up @@ -273,7 +273,7 @@ const Index: React.FC = () => {
setFormData({ ...formData });
if (res.e_mail) {
const str = res.e_mail.toLowerCase().trim();
const hash = MD5(str);
const hash = sha256(str);
setMailHash(hash);
}
});
Expand Down

0 comments on commit c3a1704

Please # to comment.