File tree Expand file tree Collapse file tree 10 files changed +23
-48
lines changed
Expand file tree Collapse file tree 10 files changed +23
-48
lines changed Original file line number Diff line number Diff line change 1+ /** Shared className for primary auth form submit buttons across all auth pages. */
2+ export const AUTH_SUBMIT_BTN =
3+ 'inline-flex h-[32px] w-full items-center justify-center gap-2 rounded-[5px] border border-white bg-white px-2.5 font-[430] font-season text-black text-sm transition-colors hover:border-[var(--border-1)] hover:bg-[var(--border-1)] disabled:cursor-not-allowed disabled:opacity-50' as const
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { useRouter } from 'next/navigation'
44import { Button } from '@/components/emcn'
55import { getEnv , isTruthy } from '@/lib/core/config/env'
66import { cn } from '@/lib/core/utils/cn'
7+ import { AUTH_SUBMIT_BTN } from '@/app/(auth)/components/auth-button-classes'
78
89interface SSOLoginButtonProps {
910 callbackURL ?: string
@@ -27,18 +28,14 @@ export function SSOLoginButton({
2728 router . push ( ssoUrl )
2829 }
2930
30- const primaryBtnClasses = cn (
31- 'flex w-full items-center justify-center gap-2 rounded-[10px] border border-[#6f3dfa] bg-gradient-to-b from-[#8357ff] to-[#6f3dfa] font-medium text-base text-white shadow-[inset_0_2px_4px_0_#9b77ff] transition-all duration-200 hover:opacity-90'
32- )
33-
3431 const outlineBtnClasses = cn ( 'w-full rounded-[10px]' )
3532
3633 return (
3734 < Button
3835 type = 'button'
3936 onClick = { handleSSOClick }
4037 variant = { variant === 'outline' ? 'outline' : undefined }
41- className = { cn ( variant === 'outline' ? outlineBtnClasses : primaryBtnClasses , className ) }
38+ className = { cn ( variant === 'outline' ? outlineBtnClasses : AUTH_SUBMIT_BTN , className ) }
4239 >
4340 Sign in with SSO
4441 </ Button >
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import { validateCallbackUrl } from '@/lib/core/security/input-validation'
2020import { cn } from '@/lib/core/utils/cn'
2121import { getBaseUrl } from '@/lib/core/utils/urls'
2222import { quickValidateEmail } from '@/lib/messaging/email/validation'
23+ import { AUTH_SUBMIT_BTN } from '@/app/(auth)/components/auth-button-classes'
2324import { SocialLoginButtons } from '@/app/(auth)/components/social-login-buttons'
2425import { SSOLoginButton } from '@/app/(auth)/components/sso-login-button'
2526
@@ -446,11 +447,7 @@ export default function LoginPage({
446447 </ div >
447448 ) }
448449
449- < button
450- type = 'submit'
451- disabled = { isLoading }
452- className = 'inline-flex h-[32px] w-full items-center justify-center gap-2 rounded-[5px] border border-white bg-white px-2.5 font-[430] font-season text-black text-sm transition-colors hover:border-[var(--border-1)] hover:bg-[var(--border-1)] disabled:cursor-not-allowed disabled:opacity-50'
453- >
450+ < button type = 'submit' disabled = { isLoading } className = { AUTH_SUBMIT_BTN } >
454451 { isLoading ? (
455452 < span className = 'flex items-center gap-2' >
456453 < Loader2 className = 'h-4 w-4 animate-spin' />
@@ -565,11 +562,7 @@ export default function LoginPage({
565562 < p > { resetStatus . message } </ p >
566563 </ div >
567564 ) }
568- < button
569- type = 'submit'
570- disabled = { isSubmittingReset }
571- className = 'inline-flex h-[32px] w-full items-center justify-center gap-2 rounded-[5px] border border-white bg-white px-2.5 font-[430] font-season text-black text-sm transition-colors hover:border-[var(--border-1)] hover:bg-[var(--border-1)] disabled:cursor-not-allowed disabled:opacity-50'
572- >
565+ < button type = 'submit' disabled = { isSubmittingReset } className = { AUTH_SUBMIT_BTN } >
573566 { isSubmittingReset ? (
574567 < span className = 'flex items-center gap-2' >
575568 < Loader2 className = 'h-4 w-4 animate-spin' />
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import Image from 'next/image'
66import { useRouter , useSearchParams } from 'next/navigation'
77import { Button } from '@/components/emcn'
88import { signOut , useSession } from '@/lib/auth/auth-client'
9+ import { AUTH_SUBMIT_BTN } from '@/app/(auth)/components/auth-button-classes'
910
1011const SCOPE_DESCRIPTIONS : Record < string , string > = {
1112 openid : 'Verify your identity' ,
@@ -149,10 +150,7 @@ export default function OAuthConsentPage() {
149150 </ p >
150151 </ div >
151152 < div className = 'mt-8 w-full max-w-[410px] space-y-3' >
152- < button
153- onClick = { ( ) => router . push ( '/' ) }
154- className = 'inline-flex h-[32px] w-full items-center justify-center gap-2 rounded-[5px] border border-white bg-white px-2.5 font-[430] font-season text-black text-sm transition-colors hover:border-[var(--border-1)] hover:bg-[var(--border-1)] disabled:cursor-not-allowed disabled:opacity-50'
155- >
153+ < button onClick = { ( ) => router . push ( '/' ) } className = { AUTH_SUBMIT_BTN } >
156154 Return to Home
157155 </ button >
158156 </ div >
@@ -264,7 +262,7 @@ export default function OAuthConsentPage() {
264262 < button
265263 onClick = { ( ) => handleConsent ( true ) }
266264 disabled = { submitting }
267- className = 'inline-flex h-[32px] w-full items-center justify-center gap-2 rounded-[5px] border border-white bg-white px-2.5 font-[430] font-season text-black text-sm transition-colors hover:border-[var(--border-1)] hover:bg-[var(--border-1)] disabled:cursor-not-allowed disabled:opacity-50'
265+ className = { AUTH_SUBMIT_BTN }
268266 >
269267 { submitting ? (
270268 < span className = 'flex items-center gap-2' >
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { useState } from 'react'
44import { Eye , EyeOff , Loader2 } from 'lucide-react'
55import { Input , Label } from '@/components/emcn'
66import { cn } from '@/lib/core/utils/cn'
7+ import { AUTH_SUBMIT_BTN } from '@/app/(auth)/components/auth-button-classes'
78
89interface RequestResetFormProps {
910 email : string
@@ -63,11 +64,7 @@ export function RequestResetForm({
6364 ) }
6465 </ div >
6566
66- < button
67- type = 'submit'
68- disabled = { isSubmitting }
69- className = 'inline-flex h-[32px] w-full items-center justify-center gap-2 rounded-[5px] border border-white bg-white px-2.5 font-[430] font-season text-black text-sm transition-colors hover:border-[var(--border-1)] hover:bg-[var(--border-1)] disabled:cursor-not-allowed disabled:opacity-50'
70- >
67+ < button type = 'submit' disabled = { isSubmitting } className = { AUTH_SUBMIT_BTN } >
7168 { isSubmitting ? (
7269 < span className = 'flex items-center gap-2' >
7370 < Loader2 className = 'h-4 w-4 animate-spin' />
@@ -224,11 +221,7 @@ export function SetNewPasswordForm({
224221 ) }
225222 </ div >
226223
227- < button
228- type = 'submit'
229- disabled = { isSubmitting || ! token }
230- className = 'inline-flex h-[32px] w-full items-center justify-center gap-2 rounded-[5px] border border-white bg-white px-2.5 font-[430] font-season text-black text-sm transition-colors hover:border-[var(--border-1)] hover:bg-[var(--border-1)] disabled:cursor-not-allowed disabled:opacity-50'
231- >
224+ < button type = 'submit' disabled = { isSubmitting || ! token } className = { AUTH_SUBMIT_BTN } >
232225 { isSubmitting ? (
233226 < span className = 'flex items-center gap-2' >
234227 < Loader2 className = 'h-4 w-4 animate-spin' />
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import { client, useSession } from '@/lib/auth/auth-client'
1111import { getEnv , isFalsy , isTruthy } from '@/lib/core/config/env'
1212import { cn } from '@/lib/core/utils/cn'
1313import { quickValidateEmail } from '@/lib/messaging/email/validation'
14+ import { AUTH_SUBMIT_BTN } from '@/app/(auth)/components/auth-button-classes'
1415import { SocialLoginButtons } from '@/app/(auth)/components/social-login-buttons'
1516import { SSOLoginButton } from '@/app/(auth)/components/sso-login-button'
1617
@@ -540,11 +541,7 @@ function SignupFormContent({
540541 </ div >
541542 ) }
542543
543- < button
544- type = 'submit'
545- disabled = { isLoading }
546- className = '!mt-6 inline-flex h-[32px] w-full items-center justify-center gap-2 rounded-[5px] border border-white bg-white px-2.5 font-[430] font-season text-black text-sm transition-colors hover:border-[var(--border-1)] hover:bg-[var(--border-1)] disabled:cursor-not-allowed disabled:opacity-50'
547- >
544+ < button type = 'submit' disabled = { isLoading } className = { cn ( '!mt-6' , AUTH_SUBMIT_BTN ) } >
548545 { isLoading ? (
549546 < span className = 'flex items-center gap-2' >
550547 < Loader2 className = 'h-4 w-4 animate-spin' />
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { Loader2 } from 'lucide-react'
55import { useRouter } from 'next/navigation'
66import { InputOTP , InputOTPGroup , InputOTPSlot } from '@/components/emcn'
77import { cn } from '@/lib/core/utils/cn'
8+ import { AUTH_SUBMIT_BTN } from '@/app/(auth)/components/auth-button-classes'
89import { useVerification } from '@/app/(auth)/verify/use-verification'
910
1011interface VerifyContentProps {
@@ -113,7 +114,7 @@ function VerificationForm({
113114 < button
114115 onClick = { verifyCode }
115116 disabled = { ! isOtpComplete || isLoading }
116- className = 'inline-flex h-[32px] w-full items-center justify-center gap-2 rounded-[5px] border border-white bg-white px-2.5 font-[430] font-season text-black text-sm transition-colors hover:border-[var(--border-1)] hover:bg-[var(--border-1)] disabled:cursor-not-allowed disabled:opacity-50'
117+ className = { AUTH_SUBMIT_BTN }
117118 >
118119 { isLoading ? (
119120 < span className = 'flex items-center gap-2' >
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { Input, Label } from '@/components/emcn'
88import { cn } from '@/lib/core/utils/cn'
99import { quickValidateEmail } from '@/lib/messaging/email/validation'
1010import AuthBackground from '@/app/(auth)/components/auth-background'
11+ import { AUTH_SUBMIT_BTN } from '@/app/(auth)/components/auth-button-classes'
1112import { SupportFooter } from '@/app/(auth)/components/support-footer'
1213import Navbar from '@/app/(home)/components/navbar/navbar'
1314
@@ -152,11 +153,7 @@ export default function SSOAuth({ identifier }: SSOAuthProps) {
152153 ) }
153154 </ div >
154155
155- < button
156- type = 'submit'
157- disabled = { isLoading }
158- className = 'inline-flex h-[32px] w-full items-center justify-center gap-2 rounded-[5px] border border-white bg-white px-2.5 font-[430] font-season text-black text-sm transition-colors hover:border-[var(--border-1)] hover:bg-[var(--border-1)] disabled:cursor-not-allowed disabled:opacity-50'
159- >
156+ < button type = 'submit' disabled = { isLoading } className = { AUTH_SUBMIT_BTN } >
160157 { isLoading ? (
161158 < span className = 'flex items-center gap-2' >
162159 < Loader2 className = 'h-4 w-4 animate-spin' />
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import { env, isFalsy } from '@/lib/core/config/env'
1111import { validateCallbackUrl } from '@/lib/core/security/input-validation'
1212import { cn } from '@/lib/core/utils/cn'
1313import { quickValidateEmail } from '@/lib/messaging/email/validation'
14+ import { AUTH_SUBMIT_BTN } from '@/app/(auth)/components/auth-button-classes'
1415
1516const logger = createLogger ( 'SSOForm' )
1617
@@ -50,13 +51,11 @@ export default function SSOForm() {
5051 }
5152 }
5253
53- // Pre-fill email if provided in URL (e.g., from deployed chat SSO)
5454 const emailParam = searchParams . get ( 'email' )
5555 if ( emailParam ) {
5656 setEmail ( emailParam )
5757 }
5858
59- // Check for SSO error from redirect
6059 const error = searchParams . get ( 'error' )
6160 if ( error ) {
6261 const errorMessages : Record < string , string > = {
@@ -183,11 +182,7 @@ export default function SSOForm() {
183182 </ div >
184183 </ div >
185184
186- < button
187- type = 'submit'
188- disabled = { isLoading }
189- className = 'inline-flex h-[32px] w-full items-center justify-center gap-2 rounded-[5px] border border-white bg-white px-2.5 font-[430] font-season text-black text-sm transition-colors hover:border-[var(--border-1)] hover:bg-[var(--border-1)] disabled:cursor-not-allowed disabled:opacity-50'
190- >
185+ < button type = 'submit' disabled = { isLoading } className = { AUTH_SUBMIT_BTN } >
191186 { isLoading ? (
192187 < span className = 'flex items-center gap-2' >
193188 < Loader2 className = 'h-4 w-4 animate-spin' />
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { db } from '@sim/db'
22import { copilotChats } from '@sim/db/schema'
33import { createLogger } from '@sim/logger'
44import { eq , sql } from 'drizzle-orm'
5+ import { isEphemeralResource } from '@/lib/copilot/resource-extraction'
56import type { MothershipResource } from '@/lib/copilot/resource-types'
67
78export {
You can’t perform that action at this time.
0 commit comments