Skip to content

Commit b3cbb2f

Browse files
committed
fix: added code rabbit suggestion
1 parent e9d521e commit b3cbb2f

File tree

1 file changed

+12
-0
lines changed
  • infrastructure/eid-wallet/src/routes/(auth)/register

1 file changed

+12
-0
lines changed

infrastructure/eid-wallet/src/routes/(auth)/register/+page.svelte

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ const handleConfirmFirst = () => {
3838
};
3939
4040
const handleConfirmRepeat = async () => {
41+
if (repeatPin.length !== 4) return;
42+
4143
if (pin !== repeatPin) {
4244
isError = true;
4345
currentStep = "CREATE";
@@ -46,7 +48,17 @@ const handleConfirmRepeat = async () => {
4648
return;
4749
}
4850
51+
if (!globalState) {
52+
console.error("Global state not available; cannot set onboarding PIN.");
53+
isError = true;
54+
currentStep = "CREATE";
55+
pin = "";
56+
repeatPin = "";
57+
return;
58+
}
59+
4960
try {
61+
isError = false;
5062
await globalState?.securityController.setOnboardingPin(pin, repeatPin);
5163
currentStep = "PIN_DONE";
5264
} catch (error) {

0 commit comments

Comments
 (0)