2017-07-22 21:27:38 +05:30
|
|
|
|
import React from 'react';
|
2020-06-04 22:11:27 +05:30
|
|
|
|
import { defineMessages, FormattedMessage as Message } from 'react-intl';
|
2017-07-22 21:27:38 +05:30
|
|
|
|
|
2020-01-18 02:07:52 +05:30
|
|
|
|
import { Input, Form, FormModel } from 'app/components/ui/form';
|
2019-12-08 00:32:00 +05:30
|
|
|
|
import profileForm from 'app/components/profile/profileForm.scss';
|
2020-01-18 02:07:52 +05:30
|
|
|
|
|
2020-06-04 22:11:27 +05:30
|
|
|
|
const messages = defineMessages({
|
|
|
|
|
codePlaceholder: 'Enter the code here',
|
|
|
|
|
});
|
2017-07-22 21:27:38 +05:30
|
|
|
|
|
|
|
|
|
export default function Confirmation({
|
2020-05-24 04:38:24 +05:30
|
|
|
|
form,
|
|
|
|
|
formRef = () => {},
|
|
|
|
|
onSubmit,
|
|
|
|
|
onInvalid,
|
2017-07-22 21:27:38 +05:30
|
|
|
|
}: {
|
2020-05-24 04:38:24 +05:30
|
|
|
|
form: FormModel;
|
|
|
|
|
formRef?: (el: Form | null) => void;
|
|
|
|
|
onSubmit: (form: FormModel) => Promise<void> | void;
|
|
|
|
|
onInvalid: () => void;
|
2017-07-22 21:27:38 +05:30
|
|
|
|
}) {
|
2020-05-24 04:38:24 +05:30
|
|
|
|
return (
|
|
|
|
|
<Form form={form} onSubmit={onSubmit} onInvalid={onInvalid} ref={formRef}>
|
|
|
|
|
<div className={profileForm.formBody}>
|
|
|
|
|
<div className={profileForm.formRow}>
|
|
|
|
|
<p className={profileForm.description}>
|
2020-06-04 22:11:27 +05:30
|
|
|
|
<Message
|
|
|
|
|
key="enterCodeFromApp"
|
|
|
|
|
defaultMessage="In order to finish two‑factor auth setup, please enter the code received in the mobile app:"
|
|
|
|
|
/>
|
2020-05-24 04:38:24 +05:30
|
|
|
|
</p>
|
|
|
|
|
</div>
|
2017-07-22 21:27:38 +05:30
|
|
|
|
|
2020-05-24 04:38:24 +05:30
|
|
|
|
<div className={profileForm.formRow}>
|
|
|
|
|
<Input
|
|
|
|
|
{...form.bindField('totp')}
|
|
|
|
|
required
|
|
|
|
|
autoComplete="off"
|
|
|
|
|
skin="light"
|
|
|
|
|
placeholder={messages.codePlaceholder}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</Form>
|
|
|
|
|
);
|
2017-07-22 21:27:38 +05:30
|
|
|
|
}
|