Block API access when 2FA is required on account; closes #2791

This commit is contained in:
Dane Everitt 2020-12-06 13:56:14 -08:00
parent 5d23d894ae
commit d22456d9ca
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
8 changed files with 101 additions and 40 deletions

View file

@ -7,9 +7,11 @@ import PageContentBlock from '@/components/elements/PageContentBlock';
import tw from 'twin.macro';
import { breakpoint } from '@/theme';
import styled from 'styled-components/macro';
import { RouteComponentProps } from 'react-router';
import MessageBox from '@/components/MessageBox';
const Container = styled.div`
${tw`flex flex-wrap my-10`};
${tw`flex flex-wrap`};
& > div {
${tw`w-full`};
@ -24,10 +26,15 @@ const Container = styled.div`
}
`;
export default () => {
export default ({ location: { state } }: RouteComponentProps) => {
return (
<PageContentBlock title={'Account Overview'}>
<Container>
{state?.twoFactorRedirect &&
<MessageBox title={'2-Factor Required'} type={'error'}>
Your account must have two-factor authentication enabled in order to continue.
</MessageBox>
}
<Container css={[ tw`mb-10`, state?.twoFactorRedirect ? tw`mt-4` : tw`mt-10` ]}>
<ContentBox title={'Update Password'} showFlashes={'account:password'}>
<UpdatePasswordForm/>
</ContentBox>