()
| 124 | ); |
| 125 | |
| 126 | const inner = () => { |
| 127 | if (loading) { |
| 128 | /* noop */ |
| 129 | } else if (graphqlQueryError) { |
| 130 | return <ErrorAlert error={graphqlQueryError} />; |
| 131 | } else if (data && data.currentUser && !data.currentUser.hasPassword) { |
| 132 | return ( |
| 133 | <div> |
| 134 | <PageHeader title="Change passphrase" /> |
| 135 | <P> |
| 136 | You registered your account through social login, so you do not |
| 137 | currently have a passphrase. If you would like a passphrase, press |
| 138 | the button below to request a passphrase reset email to '{email}' |
| 139 | (you can choose a different email by making it primary in{" "} |
| 140 | <Link href="/settings/emails">email settings</Link>). |
| 141 | </P> |
| 142 | <Button onClick={handleResetPassword} disabled={resetInProgress}> |
| 143 | Reset passphrase |
| 144 | </Button> |
| 145 | </div> |
| 146 | ); |
| 147 | } |
| 148 | |
| 149 | const code = getCodeFromError(error); |
| 150 | return ( |
| 151 | <div> |
| 152 | <PageHeader title="Change passphrase" /> |
| 153 | <Form |
| 154 | {...formItemLayout} |
| 155 | form={form} |
| 156 | onFinish={handleSubmit} |
| 157 | onValuesChange={handleValuesChange} |
| 158 | > |
| 159 | <Form.Item |
| 160 | label="Old passphrase" |
| 161 | name="oldPassword" |
| 162 | rules={[ |
| 163 | { |
| 164 | required: true, |
| 165 | message: "Please input your passphrase", |
| 166 | }, |
| 167 | ]} |
| 168 | > |
| 169 | <Input type="password" /> |
| 170 | </Form.Item> |
| 171 | <Form.Item label="New passphrase" required> |
| 172 | <Form.Item |
| 173 | noStyle |
| 174 | name="newPassword" |
| 175 | rules={[ |
| 176 | { |
| 177 | required: true, |
| 178 | message: "Please confirm your passphrase", |
| 179 | }, |
| 180 | ]} |
| 181 | > |
| 182 | <Input |
| 183 | type="password" |
no test coverage detected