import { useRouter } from 'next/router' import AlertError from 'components/ui/AlertError' import { OrganizationInviteByToken } from 'data/organization-members/organization-invitation-token-query' import { useSignOut } from 'lib/auth' import { useProfile } from 'lib/profile' import { ResponseError } from 'types' import { cn } from 'ui' interface OrganizationInviteError { data?: OrganizationInviteByToken error?: ResponseError isError: boolean } export const OrganizationInviteError = ({ data, error, isError }: OrganizationInviteError) => { const router = useRouter() const signOut = useSignOut() const { profile } = useProfile() return (
The invite token is invalid.
Try copying and pasting the link from the invite email, or ask the organization owner to invite you again.
Your email address {profile?.primary_email} does not match the email address this invitation was sent to.
To accept this invitation, you will need to{' '} { await signOut() router.reload() }} > sign out {' '} and then sign in or create a new account using the same email address used in the invitation.
The invite token has expired.
Please request a new one from the organization owner.