Add login flow

Present user with a login form to input token when connection fails or
the token is not present in local storage.  Replaces the settings page.
This commit is contained in:
Hornwitser committed 2020-10-29 19:11:10 +01:00
1 parent 019ffc25f0
commit 0c0626564a
9 files changed
+128 -96

No files matched your search

@@ -0,0 +1,27 @@
import React from "react";
import { Form, Input, Button } from "antd";
import LockOutlined from "@ant-design/icons/LockOutlined";
export default function LoginForm(props) {
return (
<Form
name="login"
onFinish={(values) => { props.setToken(values.token); }}
>
<Form.Item
name="token"
rules={[
{ required: true, message: "Please input authentication token" },
]}
>
<Input
prefix={<LockOutlined className="site-form-item-icon" />}
type="password"
placeholder="Authentication Token"
/>
</Form.Item>
<Button type="primary" htmlType="submit">Log in</Button>
</Form>
);
}