Fix:auto redirect

This commit is contained in:
Shreyaschorge 2025-07-11 20:51:12 +05:30
parent c7583b2ffe
commit 5724c92b88
No known key found for this signature in database
2 changed files with 71 additions and 74 deletions

View File

@ -118,9 +118,9 @@ export function AuthDialog({
const content = getStepContent(); const content = getStepContent();
return ( return (
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm"> <div className="fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm p-4">
<div className="bg-white dark:bg-gray-800 rounded-xl p-6 max-w-md mx-4 shadow-2xl border border-gray-200 dark:border-gray-700"> <div className="bg-white dark:bg-gray-800 rounded-xl w-full max-w-md shadow-2xl border border-gray-200 dark:border-gray-700 max-h-[80vh] sm:max-h-[90vh] flex flex-col">
<div className="flex justify-between items-center mb-4"> <div className="flex justify-between items-center p-4 sm:p-6 pb-3 sm:pb-4 border-b border-gray-200 dark:border-gray-700 flex-shrink-0">
<h2 className="text-lg font-semibold text-gray-900 dark:text-gray-100"> <h2 className="text-lg font-semibold text-gray-900 dark:text-gray-100">
{isError ? 'Error' : content.title} {isError ? 'Error' : content.title}
</h2> </h2>
@ -144,6 +144,7 @@ export function AuthDialog({
</button> </button>
</div> </div>
<div className="flex-1 overflow-y-auto p-4 sm:p-6 pt-3 sm:pt-4 min-h-0">
{isError ? ( {isError ? (
<div className="text-center"> <div className="text-center">
<div className="text-red-600 dark:text-red-400 mb-4"> <div className="text-red-600 dark:text-red-400 mb-4">
@ -213,5 +214,6 @@ export function AuthDialog({
)} )}
</div> </div>
</div> </div>
</div>
); );
} }

View File

@ -378,7 +378,7 @@ export function NeynarAuthButton() {
} }
// For backend flow, the session will be handled by NextAuth // For backend flow, the session will be handled by NextAuth
}, },
[useBackendFlow] [useBackendFlow, fetchUserData]
); );
// Error callback // Error callback
@ -538,12 +538,7 @@ export function NeynarAuthButton() {
setDialogStep('signin'); setDialogStep('signin');
setShowDialog(true); setShowDialog(true);
frontendSignIn(); frontendSignIn();
}, [isError, reconnect, frontendSignIn]);
// Open mobile app if on mobile and URL is available
if (url && isMobile()) {
window.open(url, '_blank');
}
}, [isError, reconnect, frontendSignIn, url]);
const handleSignOut = useCallback(async () => { const handleSignOut = useCallback(async () => {
try { try {