rm client side logs

This commit is contained in:
peintnermax
2024-09-20 10:21:22 +02:00
parent ed8813093e
commit c28eeb3cab
9 changed files with 27 additions and 39 deletions

View File

@@ -55,8 +55,8 @@ export default function ChangePasswordForm({
sessionId: sessionId,
userId: userId,
password: values.password,
}).catch((error: Error) => {
setError(error.message ?? "Could not change password");
}).catch(() => {
setError("Could not change password");
});
setLoading(false);

View File

@@ -90,8 +90,8 @@ export default function LoginPasskey({
},
}),
authRequestId,
}).catch((error: Error) => {
setError(error.message);
}).catch(() => {
setError("Could not request passkey challenge");
});
setLoading(false);
@@ -108,8 +108,8 @@ export default function LoginPasskey({
webAuthN: { credentialAssertionData: data },
} as Checks,
authRequestId,
}).catch((error: Error) => {
setError(error.message);
}).catch(() => {
setError("Could not verify passkey");
});
setLoading(false);

View File

@@ -57,9 +57,8 @@ export default function PasswordForm({
password: { password: values.password },
}),
authRequestId,
}).catch((error: Error) => {
setError(error.message ?? "Could not verify password");
setLoading(false);
}).catch(() => {
setError("Could not verify password");
});
if (response && "error" in response && response.error) {
@@ -79,9 +78,7 @@ export default function PasswordForm({
const response = await resetPassword({
loginName,
organization,
}).catch((error: Error) => {
console.error(error);
setLoading(false);
}).catch(() => {
setError("Could not reset password");
});

View File

@@ -47,9 +47,8 @@ export default function RegisterPasskey({
passkeyName,
publicKeyCredential,
sessionId,
}).catch((error: Error) => {
setError(error.message);
setLoading(false);
}).catch(() => {
setError("Could not verify Passkey");
});
setLoading(false);
@@ -60,9 +59,8 @@ export default function RegisterPasskey({
setLoading(true);
const resp = await registerPasskeyLink({
sessionId,
}).catch((error: Error) => {
setError(error.message ?? "Could not register passkey");
setLoading(false);
}).catch(() => {
setError("Could not register passkey");
});
setLoading(false);

View File

@@ -44,9 +44,7 @@ export default function RegisterU2F({
passkeyName,
publicKeyCredential,
sessionId,
}).catch((error: Error) => {
console.error(error);
setLoading(false);
}).catch(() => {
setError("An error on verifying passkey occurred");
});
@@ -64,18 +62,17 @@ export default function RegisterU2F({
setLoading(true);
const response = await addU2F({
sessionId,
}).catch((error: Error) => {
console.error(error);
setLoading(false);
}).catch(() => {
setError("An error on registering passkey");
});
setLoading(false);
if (response && "error" in response && response?.error) {
setError(response?.error);
}
if (!response || !("u2fId" in response)) {
setLoading(false);
setError("An error on registering passkey");
return;
}

View File

@@ -65,8 +65,7 @@ export default function SetPasswordForm({
organization: organization,
authRequestId: authRequestId,
password: values.password,
}).catch((error: Error) => {
console.error(error);
}).catch(() => {
setError("Could not register user");
});

View File

@@ -53,8 +53,8 @@ export function SignInWithIDP({
`${host}/idp/${provider}/success?` + new URLSearchParams(params),
failureUrl:
`${host}/idp/${provider}/failure?` + new URLSearchParams(params),
}).catch((error: Error) => {
setError(error.message ?? "Could not start IDP flow");
}).catch(() => {
setError("Could not start IDP flow");
});
setLoading(false);

View File

@@ -50,17 +50,16 @@ export default function UsernameForm({
loginName: values.loginName,
organization,
authRequestId,
}).catch((error: Error) => {
console.error(error);
}).catch(() => {
setError("An internal error occurred");
});
setLoading(false);
if (res?.error) {
setError(res.error);
}
setLoading(false);
return res;
}

View File

@@ -60,9 +60,8 @@ export default function VerifyEmailForm({
setLoading(true);
const response = await resendVerifyEmail({
userId,
}).catch((error: Error) => {
setLoading(false);
setError(error.message);
}).catch(() => {
setError("Could not resend email");
});
setLoading(false);
@@ -74,9 +73,8 @@ export default function VerifyEmailForm({
const verifyResponse = await verifyUserByEmail({
code: value.code,
userId,
}).catch((error: Error) => {
setLoading(false);
setError(error.message ?? "Could not verify email");
}).catch(() => {
setError("Could not verify email");
});
setLoading(false);