Skip to content

Commit ce4eba8

Browse files
committed
fix(auth): use neutral links for email verification
1 parent 9703b07 commit ce4eba8

4 files changed

Lines changed: 11 additions & 24 deletions

File tree

‎apps/sim/app/(auth)/components/auth-button-classes.ts‎

Lines changed: 0 additions & 3 deletions
This file was deleted.

‎apps/sim/app/(auth)/components/auth-text-link.tsx‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ interface AuthTextLinkProps {
2121
/**
2222
* The canonical inline text affordance for the auth pages — forgot-password,
2323
* resend, and the legal links. Renders a {@link Link} when `href` is set and a
24-
* `<button>` otherwise, both in one light-token style. Replaces the legacy dark
25-
* `AUTH_TEXT_LINK` class string with a single props-driven source of truth.
24+
* `<button>` otherwise, both using the shared neutral text tokens.
2625
*/
2726
export function AuthTextLink({
2827
children,

‎apps/sim/app/(interfaces)/chat/components/auth/email/email-auth.tsx‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import { cn, Input, InputOTP, InputOTPGroup, InputOTPSlot, Label } from '@sim/em
55
import { createLogger } from '@sim/logger'
66
import { toError } from '@sim/utils/errors'
77
import { quickValidateEmail } from '@/lib/messaging/email/validation'
8-
import { AuthSubmitButton } from '@/app/(auth)/components'
9-
import { AUTH_TEXT_LINK } from '@/app/(auth)/components/auth-button-classes'
8+
import { AuthSubmitButton, AuthTextLink } from '@/app/(auth)/components'
109
import { useChatEmailOtpRequest, useChatEmailOtpVerify } from '@/hooks/queries/chats'
1110

1211
const logger = createLogger('EmailAuth')
@@ -220,28 +219,26 @@ export default function EmailAuth({ identifier }: EmailAuthProps) {
220219
Resend in <span className='text-[var(--text-primary)]'>{countdown}s</span>
221220
</span>
222221
) : (
223-
<button
224-
className={AUTH_TEXT_LINK}
222+
<AuthTextLink
225223
onClick={handleResendOtp}
226224
disabled={verifyOtp.isPending || requestOtp.isPending}
227225
>
228226
Resend
229-
</button>
227+
</AuthTextLink>
230228
)}
231229
</p>
232230
</div>
233231

234232
<div className='text-center font-light text-sm'>
235-
<button
233+
<AuthTextLink
236234
onClick={() => {
237235
setShowOtpVerification(false)
238236
setOtpValue('')
239237
setAuthError(null)
240238
}}
241-
className={AUTH_TEXT_LINK}
242239
>
243240
Change email
244-
</button>
241+
</AuthTextLink>
245242
</div>
246243
</div>
247244
)}

‎apps/sim/app/f/[token]/public-file-email-auth.tsx‎

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import { getErrorMessage } from '@sim/utils/errors'
66
import { normalizeEmail } from '@sim/utils/string'
77
import { useRouter } from 'next/navigation'
88
import { quickValidateEmail } from '@/lib/messaging/email/validation'
9-
import { AuthSubmitButton } from '@/app/(auth)/components'
10-
import { AUTH_TEXT_LINK } from '@/app/(auth)/components/auth-button-classes'
9+
import { AuthSubmitButton, AuthTextLink } from '@/app/(auth)/components'
1110
import { PublicFileAuthShell } from '@/app/f/[token]/public-file-auth-shell'
1211
import { usePublicFileOtpRequest, usePublicFileOtpVerify } from '@/hooks/queries/public-shares'
1312

@@ -176,28 +175,23 @@ export function PublicFileEmailAuth({ token }: PublicFileEmailAuthProps) {
176175
Resend in <span className='text-[var(--text-primary)]'>{countdown}s</span>
177176
</span>
178177
) : (
179-
<button
180-
className={AUTH_TEXT_LINK}
181-
onClick={resend}
182-
disabled={requestOtp.isPending || verifyOtp.isPending}
183-
>
178+
<AuthTextLink onClick={resend} disabled={requestOtp.isPending || verifyOtp.isPending}>
184179
Resend
185-
</button>
180+
</AuthTextLink>
186181
)}
187182
</p>
188183
</div>
189184

190185
<div className='text-center font-light text-sm'>
191-
<button
186+
<AuthTextLink
192187
onClick={() => {
193188
setSent(false)
194189
setOtp('')
195190
setError(null)
196191
}}
197-
className={AUTH_TEXT_LINK}
198192
>
199193
Change email
200-
</button>
194+
</AuthTextLink>
201195
</div>
202196
</div>
203197
</PublicFileAuthShell>

0 commit comments

Comments
 (0)