Commit f33c0bfb authored by Paul Colin Hennig's avatar Paul Colin Hennig
Browse files

add url

parent f3029496
Pipeline #708 passed with stages
in 1 minute and 14 seconds
......@@ -114,7 +114,7 @@ export default class TwoFaLogin extends Component {
const totpMethod = () => {
return (
<div>
<h1>TOTP</h1>
<h1>2FA - TOTP</h1>
<p></p>
<input value={this.state.totpToken} onChange={this.handleTotpInput} placeholder="TOTP Token" type="text" />
<button onClick={this.submitTotpToken} style={{ opacity: this.state.active ? 1 : 0.5 }} disabled={!this.state.active}>
......@@ -133,8 +133,9 @@ export default class TwoFaLogin extends Component {
const webauthnMethod = () => {
return (
<div>
<h1>WebAuthn</h1>
<button onClick={this.initWebauthn}>{this.state.webauthn ? "Retry" : "Start"}</button>
<h1>2FA - WebAuthn</h1>
<p>You chose to use WebAuthn to log in to your account.</p>
<button onClick={this.initWebauthn}>{this.state.webauthn ? "Retry" : "Authenticate"}</button>
{this.state.both ? (
<button className="altColor" onClick={() => this.props.history.goBack()}>
Go back
......
......@@ -20,7 +20,7 @@ export default class TwoFa extends Component {
totpClick = async overwriteTotp => {
const res = await f(`/interossea/v1/2fa/totp/generate`, { replace: overwriteTotp });
this.setState({ response: res, qrCode: res.qrCode, secret: res.secret });
this.setState({ response: res, qrCode: res.qrCode, secret: res.secret, url: res.url });
if (!res.error) {
this.props.history.push({ hash: "#totp" });
......@@ -116,13 +116,23 @@ export default class TwoFa extends Component {
<h1>Time-based One-Time Password</h1>
<p>
Scan this QR-Code with your TOTP app to add the shared secret to your device. <br /> If you dont have a TOTP app we recommend using{" "}
<a href="https://play.google.com/store/apps/details?id=org.shadowice.flocke.andotp">andOTP</a> for Android devices.
<a href="https://play.google.com/store/apps/details?id=org.shadowice.flocke.andotp" rel="noreferrer">
andOTP
</a>{" "}
for Android devices.
</p>
<div style={{ width: "100%" }}>
<img width="140" draggable="false" src={this.state.qrCode} alt="Qr-Code" />
</div>
<div style={{ width: "100%" }}>
<p>If you can't scan the QR-Code you may copy the secret below and add it to your app this way. (SHA-1, 6 Chars)</p>
<p>
If you can't scan the QR-Code you may add it with
<a href={this.state.url} rel="noreferrer">
this link
</a>
or copy the secret code below and add it to your app this way. (SHA-1, 6 Chars)
</p>
<h2 className="s">{this.state.secret}</h2>
</div>
<div style={{ width: "100%", float: "top", height: "1em" }}></div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment