Skip to content

Commit

Permalink
task/TUP-516: Prevent users from getting locked into SMS pairing (#243)
Browse files Browse the repository at this point in the history
* Prevent users from getting locked into SMS pairing

* formatting

---------

Co-authored-by: Jake Rosenberg <[email protected]>
  • Loading branch information
jarosenb and Jake Rosenberg authored Jun 12, 2023
1 parent 94d9b5e commit 59214c5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
11 changes: 0 additions & 11 deletions libs/tup-components/src/mfa/MfaSelection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,6 @@ import { Link, Navigate } from 'react-router-dom';
import { useMfa } from '@tacc/tup-hooks';

const MfaSelector: React.FC = () => {
const { data } = useMfa();

// If users have already generated a code with one method,
// they will need to complete registration with that method.
if (data?.token && data?.token.tokentype === 'sms') {
return <Navigate to="/mfa/sms" replace={true} />;
}
if (data?.token && data?.token.tokentype === 'totp') {
return <Navigate to="/mfa/totp" replace={true} />;
}

return (
<div className={styles['mfa-type-container']}>
Select whether you want to use an MFA token app or SMS texting for
Expand Down
4 changes: 2 additions & 2 deletions libs/tup-components/src/mfa/MfaValidationPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const MfaValidationPanel: React.FC<{ tokenType: 'totp' | 'sms' }> = ({
};

const pairingMessage = {
sms: '2. Enter the token shown in the app to continue the pairing.',
totp: '2. Enter the token sent to your phone number.',
totp: '2. Enter the token shown in the app to continue the pairing.',
sms: '2. Enter the token sent to your phone number.',
};

return (
Expand Down

0 comments on commit 59214c5

Please sign in to comment.