Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[비즈니스] 비밀번호 sha256으로 해싱 #358

Merged
merged 2 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading