Skip to content

Commit

Permalink
fix: allow skip invite params
Browse files Browse the repository at this point in the history
  • Loading branch information
bruce-glazier committed Feb 29, 2024
1 parent 2e8e8da commit a1f0aa6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
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

0 comments on commit a1f0aa6

Please sign in to comment.