Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

add proper messages

RajuGangitlace7ab5bbb6f5
diff --git a/apps/web/app/app.dub.co/(auth)/login/form.tsx b/apps/web/app/app.dub.co/(auth)/login/form.tsx
index 0562b62efe..70a479b8cc 100644
--- a/apps/web/app/app.dub.co/(auth)/login/form.tsx
+++ b/apps/web/app/app.dub.co/(auth)/login/form.tsx
@@ -45,6 +45,9 @@ const errorCodes = {
"Account has been locked due to too many login attempts. Please contact support to unlock your account.",
"too-many-login-attempts": "Too many login attempts. Please try again later.",
"email-not-verified": "Please verify your email address.",
+ "Callback": "We encountered an issue processing your request. Please try again or contact support if the problem persists.",
+ "OAuthSignin": "There was an issue signing you in. Please ensure your provider settings are correct.",
+ "OAuthCallback": "We faced a problem while processing the response from the OAuth provider. Please try again.",
};
const LoginFormContext = createContext<{
@@ -58,13 +61,13 @@ const LoginFormContext = createContext<{
setShowSSOOption: Dispatch<SetStateAction<boolean>>;
}>({
authMethod: undefined,
- setAuthMethod: () => {},
+ setAuthMethod: () => { },
clickedMethod: undefined,
showPasswordField: false,
- setShowPasswordField: () => {},
- setClickedMethod: () => {},
- setLastUsedAuthMethod: () => {},
- setShowSSOOption: () => {},
+ setShowPasswordField: () => { },
+ setClickedMethod: () => { },
+ setLastUsedAuthMethod: () => { },
+ setShowSSOOption: () => { },
});
export default function LoginForm() {
@@ -89,7 +92,11 @@ export default function LoginForm() {
useEffect(() => {
const error = searchParams?.get("error");
- error && toast.error(error);
+ if (error && errorCodes[error]) {
+ toast.error(errorCodes[error]);
+ } else {
+ toast.error("An unexpected error occurred. Please try again later.");
+ }
}, [searchParams]);
const { isMobile } = useMediaQuery();