Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: React error on forgot password page #10717

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions packages/client/components/GenericAuthentication.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,16 @@ const GenericAuthentication = (props: Props) => {
const isMicrosoftAuthEnabled = window.__ACTION__.AUTH_MICROSOFT_ENABLED
const isInternalAuthEnabled = window.__ACTION__.AUTH_INTERNAL_ENABLED
const isSSOAuthEnabled = window.__ACTION__.AUTH_SSO_ENABLED

const isCreate = page === 'create-account'
const action = isCreate ? CREATE_ACCOUNT_LABEL : SIGNIN_LABEL
const pageTitle = `${action} | Parabol`
const metaCopy = isCreate
? 'Give structure to your meetings to get your team talking and moving forward faster. Get started in 44 seconds or less.'
: 'Access Parabol to streamline your agile meetings. Collaborate, reflect, and grow with your team in real-time.'
useDocumentTitle(pageTitle, action)
useMetaTagContent(metaCopy)

if (page === 'forgot-password') {
return <ForgotPasswordPage goToPage={goToPage} />
}
Expand All @@ -89,17 +99,9 @@ const GenericAuthentication = (props: Props) => {
}
}

const isCreate = page === 'create-account'
const action = isCreate ? CREATE_ACCOUNT_LABEL : SIGNIN_LABEL
const counterAction = isCreate ? SIGNIN_LABEL : CREATE_ACCOUNT_LABEL
const counterActionSlug = isCreate ? SIGNIN_SLUG : CREATE_ACCOUNT_SLUG
const actionCopy = isCreate ? 'Already have an account? ' : 'New to Parabol? '
const pageTitle = `${action} | Parabol`
const metaCopy = isCreate
? 'Give structure to your meetings to get your team talking and moving forward faster. Get started in 44 seconds or less.'
: 'Access Parabol to streamline your agile meetings. Collaborate, reflect, and grow with your team in real-time.'
useDocumentTitle(pageTitle, action)
useMetaTagContent(metaCopy)
const title = teamName ? `${teamName} is waiting` : action
const onForgot = () => {
goToPage('forgot-password', `?email=${emailRef.current?.email()}`)
Expand Down
12 changes: 8 additions & 4 deletions packages/client/components/InvitationLinkDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,20 @@ const InvitationLinkDialog = (props: Props) => {
return <TeamInvitationErrorNotFound isMassInvite />
}
const {errorType, teamName} = massInvitation
const pageTitle = teamName ? `${teamName} | Parabol` : 'Join | Parabol'
const pageName = teamName ? `Join ${teamName}` : 'Join Parabol'
const metaCopy = teamName
? `Join ${teamName} on Parabol, the essential tool for making meetings efficient or replacing them with structured, asynchronous collaboration.`
: `Join Parabol, the essential tool for making meetings efficient or replacing them with structured, asynchronous collaboration.`
useDocumentTitle(pageTitle, pageName)
useMetaTagContent(metaCopy)

switch (errorType) {
case 'notFound':
return <TeamInvitationErrorNotFound isMassInvite />
case 'expired':
return <InvitationLinkErrorExpired massInvitation={massInvitation} />
}
useDocumentTitle(`${teamName} | Parabol`, `Join ${teamName}`)
useMetaTagContent(
`Join ${teamName} on Parabol,the essential tool for making meetings efficient or replacing them with structured, asynchronous collaboration.`
)
const {authToken} = atmosphere
if (authToken) {
return <TeamInvitationAccept invitationToken={token} />
Expand Down
Loading