Skip to content

Commit

Permalink
chore(app): update error message on oauth login
Browse files Browse the repository at this point in the history
  • Loading branch information
rhahao committed Dec 1, 2024
1 parent 06acbd5 commit 407cd6d
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const useCongregationAccessCode = () => {

if (status !== 200) {
await displayOnboardingFeedback({
title: t('tr_errorGeneric'),
title: t('error_app_generic-title'),
message: getMessageByCode(data.message),
});
showMessage();
Expand All @@ -70,7 +70,7 @@ const useCongregationAccessCode = () => {
}, 1000);
} catch (err) {
await displayOnboardingFeedback({
title: t('tr_errorGeneric'),
title: t('error_app_generic-title'),
message: getMessageByCode(err.message),
});
showMessage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const useCongregationDetails = () => {

if (status !== 200 && status !== 404) {
await displayOnboardingFeedback({
title: t('tr_errorGeneric'),
title: t('error_app_generic-title'),
message: getMessageByCode(data.message),
});
showMessage();
Expand All @@ -87,7 +87,7 @@ const useCongregationDetails = () => {

if (status === 404) {
await displayOnboardingFeedback({
title: t('tr_errorGeneric'),
title: t('error_app_generic-title'),
message: t('tr_congregationExists'),
});
showMessage();
Expand Down Expand Up @@ -149,7 +149,7 @@ const useCongregationDetails = () => {
console.error(err);

await displayOnboardingFeedback({
title: t('tr_errorGeneric'),
title: t('error_app_generic-title'),
message: getMessageByCode(err.message),
});
showMessage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const useCongregationMasterKey = () => {

if (status !== 200) {
await displayOnboardingFeedback({
title: t('tr_errorGeneric'),
title: t('error_app_generic-title'),
message: getMessageByCode(data.message),
});
showMessage();
Expand All @@ -63,7 +63,7 @@ const useCongregationMasterKey = () => {
setCurrentStep(2);
} catch (err) {
await displayOnboardingFeedback({
title: t('tr_errorGeneric'),
title: t('error_app_generic-title'),
message: getMessageByCode(err.message),
});
showMessage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const useCongregationAccessCode = () => {
} catch (err) {
console.error(err);
await displayOnboardingFeedback({
title: t('tr_errorGeneric'),
title: t('error_app_generic-title'),
message: t('tr_encryptionCodeInvalid'),
});
showMessage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const useCongregationMasterKey = () => {
} catch (err) {
console.error(err);
await displayOnboardingFeedback({
title: t('tr_errorGeneric'),
title: t('error_app_generic-title'),
message: t('tr_encryptionCodeInvalid'),
});
showMessage();
Expand Down
4 changes: 2 additions & 2 deletions src/features/app_start/vip/email_auth/useEmailAuth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const useEmailAuth = () => {

if (!isEmailValid(userTmpEmail)) {
await displayOnboardingFeedback({
title: t('tr_errorGeneric'),
title: t('error_app_generic-title'),
message: t('tr_emailNotSupported'),
});
showMessage();
Expand All @@ -47,7 +47,7 @@ const useEmailAuth = () => {

if (status !== 200) {
await displayOnboardingFeedback({
title: t('tr_errorGeneric'),
title: t('error_app_generic-title'),
message: getMessageByCode(data.message),
});
showMessage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ const useEmailLinkAuth = () => {

if (status !== 200) {
await displayOnboardingFeedback({
title: t('tr_errorGeneric'),
title: t('error_app_generic-title'),
message: getMessageByCode(data.message),
});
showMessage();
Expand Down Expand Up @@ -183,7 +183,7 @@ const useEmailLinkAuth = () => {
console.error(err);

await displayOnboardingFeedback({
title: t('tr_errorGeneric'),
title: t('error_app_generic-title'),
message: getMessageByCode(err.message),
});
showMessage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,9 @@ const useButtonBase = ({ provider, isEmail }) => {
setIsAuthProcessing(false);
} catch (error) {
console.error(error);
await handleAuthorizationError(error.code || t('tr_errorGeneric'));
await handleAuthorizationError(
error.code || error.message || t('error_app_generic-desc')
);
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/features/app_start/vip/verify_mfa/useVerifyMFA.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ const useVerifyMFA = () => {
console.error(error);

await displayOnboardingFeedback({
title: t('tr_errorGeneric'),
title: t('error_app_generic-title'),
message: getMessageByCode(error.message),
});

Expand Down

0 comments on commit 407cd6d

Please sign in to comment.