diff --git a/src/ui/pages/Secrets/TOTP/TOTPNew.tsx b/src/ui/pages/Secrets/TOTP/TOTPNew.tsx index 724032c..f80baf6 100644 --- a/src/ui/pages/Secrets/TOTP/TOTPNew.tsx +++ b/src/ui/pages/Secrets/TOTP/TOTPNew.tsx @@ -32,7 +32,7 @@ export class TOTPNewForm extends Component< } errorMessageRef = createRef(); - uriInputRef = createRef(); + nameInputRef = createRef(); async onSubmit(data: FormData): Promise { const parms = { @@ -56,6 +56,7 @@ export class TOTPNewForm extends Component<
this.onSubmit(data)}> - + {!this.state.qrMode &&

{i18next.t("totp_new_info")}

} - - - + {!this.state.qrMode && ( + <> + + + - - - - - {/* TODO: please redo this to be more like Unseal page qr mode */} + + + + + )} {this.state.qrMode && ( { - this.uriInputRef.current.value = uri; + let formData = new FormData(); + formData.set("key", ""); + formData.set("name", this.nameInputRef.current.value) + formData.set("uri", uri); + this.onSubmit(formData); this.setState({ qrMode: !this.state.qrMode }); }} />