aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/SettingsManager.tsx
diff options
context:
space:
mode:
authorkimdahey <claire_kim1@brown.edu>2019-11-23 16:59:53 -0500
committerkimdahey <claire_kim1@brown.edu>2019-11-23 16:59:53 -0500
commit56b83d89f37a5523ab319977e3385f539ecaf996 (patch)
treec7c69d0bd4cd8997ab2a97488ea5b12e5096730a /src/client/util/SettingsManager.tsx
parent66424255021c7563df93aa9de9c1535bef1d9b50 (diff)
pushing progress...need to figure out bcrypt.compare"
Diffstat (limited to 'src/client/util/SettingsManager.tsx')
-rw-r--r--src/client/util/SettingsManager.tsx22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/client/util/SettingsManager.tsx b/src/client/util/SettingsManager.tsx
index 76f4bb964..ee2d9ff21 100644
--- a/src/client/util/SettingsManager.tsx
+++ b/src/client/util/SettingsManager.tsx
@@ -18,6 +18,8 @@ export default class SettingsManager extends React.Component<{}> {
@observable private dialogueBoxOpacity = 1;
@observable private overlayOpacity = 0.4;
private curr_password_ref = React.createRef<HTMLInputElement>();
+ private new_password_ref = React.createRef<HTMLInputElement>();
+ private new_confirm_ref = React.createRef<HTMLInputElement>();
public open = action(() => {
SelectionManager.DeselectAll();
@@ -35,12 +37,19 @@ export default class SettingsManager extends React.Component<{}> {
private dispatchRequest = async () => {
const curr_pass = this.curr_password_ref.current!.value;
- const { error: resultError, ...others } = await Identified.PostToServer('/internalResetPassword', { curr_pass });
- if (resultError) {
+ const new_pass = this.new_password_ref.current!.value;
+ const new_confirm = this.new_confirm_ref.current!.value;
+ console.log('ready!');
+ // const { error, hello } = await Identified.PostToServer('/internalResetPassword', { curr_pass, new_pass, new_confirm });
+ const resp = await Identified.PostToServer('/internalResetPassword', { curr_pass, new_pass, new_confirm });
+ console.log('set!');
+ console.log('response', resp);
+ console.log('hm', resp.hm);
+ if (resp.error) {
// we failed
- console.log(resultError);
+ console.log(resp.error);
}
- console.log(others);
+ console.log('go!');
// do stuff with response
}
@@ -59,7 +68,10 @@ export default class SettingsManager extends React.Component<{}> {
<p>static data</p>
</div>
<div className="settings-content">
- <input ref={this.curr_password_ref}></input>
+ <input ref={this.curr_password_ref} />
+ <input ref={this.new_password_ref} />
+ <input ref={this.new_confirm_ref} />
+ <button onClick={this.dispatchRequest}>submit</button>
this changes with what you select!
</div>
</div>