Block API access when 2FA is required on account; closes #2791
This commit is contained in:
parent
5d23d894ae
commit
d22456d9ca
8 changed files with 101 additions and 40 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue