Skip to content

Commit f6f591f

Browse files
committed
Validate that an email and password was supplied before logging in
1 parent e388a76 commit f6f591f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/AppleID.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,14 @@ export const AppleID = ({
184184
</div>
185185
<button
186186
onClick={async () => {
187+
if (!emailInput || !passwordInput) {
188+
toast.warning("Please enter both email and password.");
189+
return;
190+
}
191+
if (!emailInput.includes("@")) {
192+
toast.warning("Please enter a valid email address.");
193+
return;
194+
}
187195
let promise = async () => {
188196
await invoke("login_new", {
189197
email: emailInput,

0 commit comments

Comments
 (0)