Skip to content

Commit 793360e

Browse files
committed
Changes to make frontend compatable with backend scaffold email verification
1 parent e74970c commit 793360e

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

src/App.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ const App: React.FC = () => {
6767
exact
6868
component={Settings}
6969
/>
70+
<Route
71+
path={Routes.VERIFY_EMAIL}
72+
exact
73+
component={VerifyEmail}
74+
/>
7075
<Route path="*" exact component={NotFound} />
7176
</Switch>
7277
);

src/containers/signup/index.tsx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,19 @@ const { Title, Paragraph } = Typography;
1919

2020
type SignupProps = UserAuthenticationReducerState;
2121

22+
interface SignupFormData extends SignupRequest {
23+
confirmPassword: string;
24+
}
25+
2226
const Signup: React.FC<SignupProps> = ({ tokens }) => {
2327
const dispatch = useDispatch();
2428
const history = useHistory();
2529

26-
const onFinish = (values: SignupRequest) => {
27-
dispatch(signup(values));
30+
const onFinish = (values: SignupFormData) => {
31+
// confirmPassword is checked in the form but should not be sent in the request
32+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
33+
const { confirmPassword, ...request } = values;
34+
dispatch(signup(request));
2835
};
2936

3037
if (getPrivilegeLevel(tokens) !== PrivilegeLevel.NONE) {
@@ -64,14 +71,6 @@ const Signup: React.FC<SignupProps> = ({ tokens }) => {
6471
<Input />
6572
</Form.Item>
6673

67-
<Form.Item
68-
label="Username"
69-
name="username"
70-
rules={[{ required: true, message: 'Required' }]}
71-
>
72-
<Input />
73-
</Form.Item>
74-
7574
<Form.Item
7675
label="Password"
7776
name="password"

0 commit comments

Comments
 (0)