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] Invitation links don't redirect to the registration form #25082

Merged
merged 1 commit into from
Apr 7, 2022
Merged
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
7 changes: 6 additions & 1 deletion client/views/invite/InvitePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { useSetting } from '../../contexts/SettingsContext';
import { useToastMessageDispatch } from '../../contexts/ToastMessagesContext';
import { useTranslation } from '../../contexts/TranslationContext';
import { useUserId } from '../../contexts/UserContext';
import LoginPage from '../root/MainLayout/LoginPage';
import PageLoading from '../root/PageLoading';

const InvitePage = (): ReactElement => {
Expand All @@ -23,7 +24,7 @@ const InvitePage = (): ReactElement => {
const groupRoute = useRoute('/group/:name/:tab?/:context?');
const channelRoute = useRoute('/channel/:name/:tab?/:context?');

const { isLoading } = useQuery(
const { isLoading, data } = useQuery(
['invite', token],
async () => {
if (!token) {
Expand Down Expand Up @@ -85,6 +86,10 @@ const InvitePage = (): ReactElement => {
},
);

if (data) {
return <LoginPage />;
}

if (isLoading) {
return <PageLoading />;
}
Expand Down