mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-06 03:00:16 -04:00
improvement(platform): ui/ux (#1357)
* improvement: branding; auth; chat-deploy * improvement: docs favicon * fix: rolled back verification logic
This commit is contained in:
@@ -51,13 +51,6 @@ export function useVerification({
|
||||
const storedEmail = sessionStorage.getItem('verificationEmail')
|
||||
if (storedEmail) {
|
||||
setEmail(storedEmail)
|
||||
} else {
|
||||
// If no email is stored, the verification session is invalid
|
||||
// Clear the verification requirement and redirect to login
|
||||
document.cookie =
|
||||
'requiresEmailVerification=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT'
|
||||
window.location.href = '/login'
|
||||
return
|
||||
}
|
||||
|
||||
// Check for redirect information
|
||||
@@ -233,30 +226,6 @@ export function useVerification({
|
||||
}
|
||||
}, [otp, email, isLoading, isVerified])
|
||||
|
||||
// Clean up verification state on unmount or after 15 minutes
|
||||
useEffect(() => {
|
||||
const cleanupTimer = setTimeout(
|
||||
() => {
|
||||
// Clear verification state after 15 minutes
|
||||
if (typeof window !== 'undefined' && !isVerified) {
|
||||
sessionStorage.removeItem('verificationEmail')
|
||||
sessionStorage.removeItem('inviteRedirectUrl')
|
||||
sessionStorage.removeItem('isInviteFlow')
|
||||
document.cookie =
|
||||
'requiresEmailVerification=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT'
|
||||
|
||||
// Redirect to login
|
||||
window.location.href = '/login'
|
||||
}
|
||||
},
|
||||
15 * 60 * 1000
|
||||
) // 15 minutes
|
||||
|
||||
return () => {
|
||||
clearTimeout(cleanupTimer)
|
||||
}
|
||||
}, [isVerified])
|
||||
|
||||
useEffect(() => {
|
||||
if (typeof window !== 'undefined') {
|
||||
if (!isProduction || !hasResendKey) {
|
||||
|
||||
@@ -232,14 +232,14 @@ function VerificationForm({
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className='text-center font-light text-[14px]'>
|
||||
{/* <div className='text-center font-light text-[14px]'>
|
||||
<button
|
||||
onClick={handleCancelVerification}
|
||||
className='font-medium text-[var(--brand-accent-hex)] underline-offset-4 transition hover:text-[var(--brand-accent-hover-hex)] hover:underline'
|
||||
>
|
||||
Back to login
|
||||
</button>
|
||||
</div>
|
||||
</div> */}
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user