Skip to content

Commit

Permalink
[비즈니스] 비밀번호 sha256으로 해싱 (#358)
Browse files Browse the repository at this point in the history
* feat: 비밀번호 sha256으로 해싱

* fix: 아이디 찾기 숨기기 및 라우팅 수정
  • Loading branch information
chaeseungyun authored Jun 21, 2024
1 parent 36d3078 commit 8a44d11
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ function App() {
<Route path="/login" element={<Login />} />
<Route element={<CommonLayout />}>
<Route path="/signup" element={<Signup />} />
<Route path="/find-id" element={<PageNotFound />} />
<Route path="/find-password" element={<FindPassword />} />
</Route>
<Route path="/find-id" element={<PageNotFound />} />
</Route>
</Route>
</Routes>
Expand Down
2 changes: 1 addition & 1 deletion src/page/Auth/Login/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export default function Login() {
{OPTION[1].name}
</Link>
)
: OPTION.map((option) => (
: OPTION.filter((option) => option.name !== '아이디 찾기').map((option) => (
<Link to={option.path} key={option.name} className={styles.option__link}>
{option.name}
</Link>
Expand Down
5 changes: 3 additions & 2 deletions src/page/Auth/components/Common/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ import sha256 from 'utils/ts/SHA-256';
import Done from '../Done/index';
import styles from './index.module.scss';

const setNewPassword = (
const setNewPassword = async (
phone_number: string,
password: string,
setError: UseFormSetError<Register>,
) => {
changePassword({ phone_number, password })
const hashPassword = await sha256(password);
changePassword({ phone_number, password: hashPassword })
.catch((e) => {
if (isKoinError(e)) {
setError('password', { type: 'custom', message: e.message });
Expand Down

0 comments on commit 8a44d11

Please sign in to comment.