Compare commits
3 Commits
af3fa26f3b
...
1a0cc9376f
| Author | SHA1 | Date | |
|---|---|---|---|
| 1a0cc9376f | |||
| b730945d34 | |||
| 17e27fca70 |
@@ -6,6 +6,7 @@ import { useAuthStore } from './store/authStore';
|
|||||||
import { PageRouting } from './const/PageRouting';
|
import { PageRouting } from './const/PageRouting';
|
||||||
import LoginPage from './ui/page/account/login/LoginPage';
|
import LoginPage from './ui/page/account/login/LoginPage';
|
||||||
import ResetPasswordPage from './ui/page/account/resetPassword/ResetPasswordPage';
|
import ResetPasswordPage from './ui/page/account/resetPassword/ResetPasswordPage';
|
||||||
|
import { HomePage } from './ui/page/home/HomePage';
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
const { authData } = useAuthStore();
|
const { authData } = useAuthStore();
|
||||||
@@ -18,6 +19,7 @@ function App() {
|
|||||||
<Route element={<SignUpPage />} path={PageRouting["SIGN_UP"].path} />
|
<Route element={<SignUpPage />} path={PageRouting["SIGN_UP"].path} />
|
||||||
<Route element={<ResetPasswordPage />} path={PageRouting["RESET_PASSWORD"].path} />
|
<Route element={<ResetPasswordPage />} path={PageRouting["RESET_PASSWORD"].path} />
|
||||||
{!authData ? <Route element={<Navigate to={PageRouting["LOGIN"].path} />} path="*" /> : null}
|
{!authData ? <Route element={<Navigate to={PageRouting["LOGIN"].path} />} path="*" /> : null}
|
||||||
|
<Route element={<HomePage />} path={PageRouting["HOME"].path} />
|
||||||
</Route>
|
</Route>
|
||||||
</Routes>
|
</Routes>
|
||||||
</Router>
|
</Router>
|
||||||
|
|||||||
@@ -76,21 +76,21 @@ export class AccountNetwork extends BaseNetwork {
|
|||||||
|
|
||||||
async sendResetPasswordCode(data: SendResetPasswordCodeRequest) {
|
async sendResetPasswordCode(data: SendResetPasswordCodeRequest) {
|
||||||
return await this.post<SendResetPasswordCodeResponse>(
|
return await this.post<SendResetPasswordCodeResponse>(
|
||||||
'/send-reset-password-code',
|
this.baseUrl + '/send-reset-password-code',
|
||||||
data
|
data
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async verifyResetPasswordCode(data: VerifyResetPasswordCodeRequest) {
|
async verifyResetPasswordCode(data: VerifyResetPasswordCodeRequest) {
|
||||||
return await this.post<VerifyResetPasswordCodeResponse>(
|
return await this.post<VerifyResetPasswordCodeResponse>(
|
||||||
'/verify-reset-password-code',
|
this.baseUrl + '/verify-reset-password-code',
|
||||||
data
|
data
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async resetPassword(data: ResetPasswordRequest) {
|
async resetPassword(data: ResetPasswordRequest) {
|
||||||
return await this.post<ResetPasswordResponse>(
|
return await this.post<ResetPasswordResponse>(
|
||||||
'/reset-password',
|
this.baseUrl + '/reset-password',
|
||||||
data
|
data
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import { Label } from '@/components/ui/label';
|
|||||||
const steps = [1, 2, 3, 4];
|
const steps = [1, 2, 3, 4];
|
||||||
|
|
||||||
export default function ResetPasswordPage() {
|
export default function ResetPasswordPage() {
|
||||||
const [currentStep, setCurrentStep] = useState(4);
|
const [currentStep, setCurrentStep] = useState(1);
|
||||||
const [showPassword, setShowPassword] = useState(false);
|
const [showPassword, setShowPassword] = useState(false);
|
||||||
const [showPasswordConfirm, setShowPasswordConfirm] = useState(false);
|
const [showPasswordConfirm, setShowPasswordConfirm] = useState(false);
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
@@ -87,11 +87,8 @@ export default function ResetPasswordPage() {
|
|||||||
|
|
||||||
const handleSecondStepOTPCompleted = async () => {
|
const handleSecondStepOTPCompleted = async () => {
|
||||||
if (isLoading) return;
|
if (isLoading) return;
|
||||||
if (!Validator.validatePasswordFormat(code)) {
|
const codeValid = await resetPasswordForm.trigger('code');
|
||||||
resetPasswordForm.setError('code', {
|
if (!codeValid) {
|
||||||
type: 'pattern',
|
|
||||||
message: '올바른 코드 형식이 아닙니다.'
|
|
||||||
});
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,7 +102,7 @@ export default function ResetPasswordPage() {
|
|||||||
try {
|
try {
|
||||||
const response = await accountNetwork.verifyResetPasswordCode(data);
|
const response = await accountNetwork.verifyResetPasswordCode(data);
|
||||||
const resData = response.data;
|
const resData = response.data;
|
||||||
|
console.log(resData);
|
||||||
if (!resData.success || !resData.verified) {
|
if (!resData.success || !resData.verified) {
|
||||||
resetPasswordForm.setError('code', {
|
resetPasswordForm.setError('code', {
|
||||||
type: 'value',
|
type: 'value',
|
||||||
|
|||||||
7
src/ui/page/home/HomePage.tsx
Normal file
7
src/ui/page/home/HomePage.tsx
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
export const HomePage = () => {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
HomePage
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user