Skip to content

Commit 3d0d64a

Browse files
ImTotemclaude
andcommitted
fix: 회원가입 새로고침 시 googleToken 없으면 1단계로 리셋
새로고침으로 메모리 상태가 날아가면 googleToken이 없어져 이후 단계에서 가입 실패. step > 1인데 token 없으면 1단계로 복귀. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 92ab196 commit 3d0d64a

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

src/pages/register/RegisterPage.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ export function RegisterPage() {
8585

8686
const register = useRegister();
8787

88+
// 새로고침 시 googleToken이 날아가면 1단계로 리셋
89+
const currentStep = state.step > 1 && !state.googleToken ? 1 : state.step;
90+
8891
const handleEmailComplete = async (email: string) => {
8992
dispatch({ type: "SET_EMAIL", schoolEmail: email });
9093
try {
@@ -115,10 +118,10 @@ export function RegisterPage() {
115118
</Alert>
116119
</div>
117120
<CardHeader>
118-
<Stepper steps={STEPS} currentStep={state.step} />
121+
<Stepper steps={STEPS} currentStep={currentStep} />
119122
</CardHeader>
120123
<CardContent>
121-
{state.step === 1 && (
124+
{currentStep === 1 && (
122125
<GoogleStep
123126
onComplete={(token) =>
124127
dispatch({
@@ -129,7 +132,7 @@ export function RegisterPage() {
129132
}
130133
/>
131134
)}
132-
{state.step === 2 && (
135+
{currentStep === 2 && (
133136
<ProfileStep
134137
defaultName={state.name || state.googleName}
135138
defaultDepartment={state.department}
@@ -142,7 +145,7 @@ export function RegisterPage() {
142145
}
143146
/>
144147
)}
145-
{state.step === 3 && (
148+
{currentStep === 3 && (
146149
<EmailStep
147150
defaultEmail={state.schoolEmail}
148151
onBack={() => dispatch({ type: "GO_BACK" })}

0 commit comments

Comments
 (0)