Skip to content

Commit

Permalink
Allow unlinking with single login method
Browse files Browse the repository at this point in the history
  • Loading branch information
nkshah2 committed Sep 13, 2023
1 parent 75830ed commit c04715b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build/static/js/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/static/js/bundle.js.map

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion src/ui/components/userDetail/loginMethods/LoginMethods.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,9 @@ export const LoginMethods: React.FC<LoginMethodProps> = ({ refetchAllData }) =>
refetchAllData={refetchAllData}
updateContext={updateLoginMethodInContext}
index={ind}
showUnlink={methods.length > 1}
showUnlink={
methods.length > 1 || (userDetail.details.isPrimaryUser === true && methods.length === 1)
}
/>
))}
</LayoutPanel>
Expand Down
4 changes: 2 additions & 2 deletions src/ui/components/userDetail/userDetailForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ export const LoginMethodUnlinkConfirmation: FC<UserUnlinkConfirmationProps> = ({
let informationToEnter = "Confirm";
let inputType = "following information";

if (loginMethod.recipeId === "emailpassword") {
if (loginMethod.recipeId === "emailpassword" || loginMethod.recipeId === "thirdparty") {
informationToEnter = loginMethod.email ?? "";
inputType = "user's email id";
}
Expand Down Expand Up @@ -594,7 +594,7 @@ export const getLoginMethodUnlinkConfirmationProps = (props: UnlinkLoginMethodPr
onConfirmed={onConfirmedUnlink}
/>
),
header: <h2>Delete User?</h2>,
header: <h2>Unlink login method?</h2>,
closeCallbackRef: closeConfirmDeleteRef,
} as LayoutModalProps;
};
Expand Down

0 comments on commit c04715b

Please sign in to comment.