fix: email verification flow and trial system
Backend fixes: - Fixed timezone-aware datetime comparison in verify_email endpoint - Added trial_ends_at (14 days) for new registrations - All datetime.now() calls now use timezone.utc Frontend additions: - Added EmailVerificationBanner component for unverified users - Banner shows warning before trial banner in Dashboard - Clear messaging about verification requirement This fixes the 500 error on email verification and ensures new users see both verification and trial status correctly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
49467ca6e9
commit
9fb6e27256
3 files changed
+54
-7
No files matched your search
@@ -0,0 +1,42 @@
|
||||
export default function EmailVerificationBanner({ profile }) {
|
||||
// Only show if email is not verified
|
||||
if (!profile || profile.email_verified !== false) return null
|
||||
|
||||
return (
|
||||
<div style={{
|
||||
background: '#FFF4E6',
|
||||
border: '2px solid #F59E0B',
|
||||
borderRadius: 12,
|
||||
padding: '16px 20px',
|
||||
marginBottom: 20,
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
gap: 16
|
||||
}}>
|
||||
<div style={{
|
||||
fontSize: 32,
|
||||
lineHeight: 1
|
||||
}}>
|
||||
📧
|
||||
</div>
|
||||
<div style={{flex: 1}}>
|
||||
<div style={{
|
||||
fontWeight: 700,
|
||||
fontSize: 15,
|
||||
color: '#D97706',
|
||||
marginBottom: 4
|
||||
}}>
|
||||
E-Mail-Adresse noch nicht bestätigt
|
||||
</div>
|
||||
<div style={{
|
||||
fontSize: 13,
|
||||
color: 'var(--text2)',
|
||||
lineHeight: 1.4
|
||||
}}>
|
||||
Bitte prüfe dein Postfach und klicke auf den Bestätigungslink.
|
||||
Ohne Bestätigung ist dein Account eingeschränkt.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import { api } from '../utils/api'
|
||||
import { useProfile } from '../context/ProfileContext'
|
||||
import { getBfCategory } from '../utils/calc'
|
||||
import TrialBanner from '../components/TrialBanner'
|
||||
import EmailVerificationBanner from '../components/EmailVerificationBanner'
|
||||
import { getInterpretation, getStatusColor, getStatusBg } from '../utils/interpret'
|
||||
import Markdown from '../utils/Markdown'
|
||||
import dayjs from 'dayjs'
|
||||
@@ -316,6 +317,9 @@ export default function Dashboard() {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Email Verification Banner */}
|
||||
<EmailVerificationBanner profile={activeProfile}/>
|
||||
|
||||
{/* Trial Banner */}
|
||||
<TrialBanner profile={activeProfile}/>
|
||||
|
||||
|
||||
Reference in new issue
Block a user