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

Allow skip invite params #535

Merged
merged 1 commit into from
Feb 29, 2024
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
1 change: 1 addition & 0 deletions src/common/DeveloperConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export type DeveloperConfig = {
items: { id: string; title: string; action: () => void }[],
) => { id: string; title: string; action: () => void }[];
navigationLinking?: LinkingOptions<any>;
skipInviteParams?: boolean;
};

export type LogoHeaderConfig = { [key in Route]?: LogoHeaderOptions };
Expand Down
4 changes: 3 additions & 1 deletion src/hooks/useOAuthFlow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { AuthResult, useAuth } from './useAuth';
import { usePendingInvite } from '../components/Invitations/InviteProvider';
import { useQueryClient } from '@tanstack/react-query';
import { _sdkAnalyticsEvent } from '../common/Analytics';
import { useDeveloperConfig } from './useDeveloperConfig';

export interface OAuthConfig {
login: (params: LoginParams) => Promise<void>;
Expand Down Expand Up @@ -76,6 +77,7 @@ export const OAuthContextProvider = ({
} = useAuth();
const pendingInvite = usePendingInvite();
const queryClient = useQueryClient();
const { skipInviteParams } = useDeveloperConfig();

const authConfig = useMemo(
() =>
Expand Down Expand Up @@ -103,7 +105,7 @@ export const OAuthContextProvider = ({
authConfig.iosPrefersEphemeralSession = true;
}

if (pendingInvite?.evc) {
if (pendingInvite?.evc && !skipInviteParams) {
authConfig.additionalParameters = {
...authConfig.additionalParameters,
inviteId: pendingInvite.inviteId,
Expand Down
Loading