Skip to content

Commit

Permalink
fix: don't skip login for setup flows (#580)
Browse files Browse the repository at this point in the history
  • Loading branch information
TejasvOnly authored Nov 9, 2024
1 parent dc5db61 commit ea05191
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ export const InheritanceGoldPlanPurchaseDialogProvider: FC<
selectedWallet.__id,
InheritanceUserTypeMap.owner,
'seed-based',
true,
);
}, [selectedWallet, walletAuthService.fetchRequestId]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ export const InheritanceSilverPlanPurchaseDialogProvider: FC<
selectedWallet.__id,
InheritanceUserTypeMap.owner,
'seed-based',
true,
);
}, [selectedWallet, walletAuthService.fetchRequestId]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ export const useWalletAuth = (onErrorCallback: (e?: any) => void) => {
walletId: string,
loginType: InheritanceUserType = InheritanceUserTypeMap.owner,
authType: 'seed-based' | 'wallet-based' = 'seed-based',
dontSkipLogin = false,
) => {
try {
walletIdRef.current = walletId;
Expand All @@ -168,7 +169,11 @@ export const useWalletAuth = (onErrorCallback: (e?: any) => void) => {
? seedAuthTokensPerWallet[walletId]
: walletAuthTokensPerWallet[walletId];

if (existingTokens && loginType === InheritanceUserTypeMap.owner) {
if (
!dontSkipLogin &&
existingTokens &&
loginType === InheritanceUserTypeMap.owner
) {
const result = await inheritanceLoginService.refreshAccessToken({
refreshToken: existingTokens.refreshToken,
});
Expand Down

0 comments on commit ea05191

Please sign in to comment.