Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ const App: React.FC = () => {
exact
component={Settings}
/>
<Route
path={Routes.VERIFY_EMAIL}
exact
component={VerifyEmail}
/>
<Route path="*" exact component={NotFound} />
</Switch>
);
Expand Down
19 changes: 9 additions & 10 deletions src/containers/signup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,19 @@ const { Title, Paragraph } = Typography;

type SignupProps = UserAuthenticationReducerState;

interface SignupFormData extends SignupRequest {
confirmPassword: string;
}

const Signup: React.FC<SignupProps> = ({ tokens }) => {
const dispatch = useDispatch();
const history = useHistory();

const onFinish = (values: SignupRequest) => {
dispatch(signup(values));
const onFinish = (values: SignupFormData) => {
// confirmPassword is checked in the form but should not be sent in the request
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { confirmPassword, ...request } = values;
dispatch(signup(request));
Comment on lines +31 to +34
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting... okay

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah pretty weird. We could change the backend to not fail with extra parameters in the request but having it there will probably save us from bugs in the long term. If you have any cleaner way of getting rid of unwanted parameters in a JS object then we can do that here instead of the destructing call

};

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

<Form.Item
label="Username"
name="username"
rules={[{ required: true, message: 'Required' }]}
>
<Input />
</Form.Item>

<Form.Item
label="Password"
name="password"
Expand Down