mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-12-01 16:51:13 +00:00
Updating totp_2fa names.
This commit is contained in:
parent
388d089d9d
commit
dce0f66190
4 changed files with 16 additions and 16 deletions
|
@ -45,7 +45,7 @@
|
|||
"inferno-server": "^8.0.6",
|
||||
"isomorphic-cookie": "^1.2.4",
|
||||
"jwt-decode": "^3.1.2",
|
||||
"lemmy-js-client": "0.17.2-rc.2",
|
||||
"lemmy-js-client": "0.17.2-rc.3",
|
||||
"markdown-it": "^13.0.1",
|
||||
"markdown-it-container": "^3.0.0",
|
||||
"markdown-it-footnote": "^3.0.3",
|
||||
|
|
|
@ -26,7 +26,7 @@ interface State {
|
|||
form: {
|
||||
username_or_email?: string;
|
||||
password?: string;
|
||||
totp_token?: string;
|
||||
totp_2fa_token?: string;
|
||||
};
|
||||
loginLoading: boolean;
|
||||
showTotp: boolean;
|
||||
|
@ -160,7 +160,7 @@ export class Login extends Component<any, State> {
|
|||
id="login-totp-token"
|
||||
pattern="[0-9]*"
|
||||
autoComplete="one-time-code"
|
||||
value={this.state.form.totp_token}
|
||||
value={this.state.form.totp_2fa_token}
|
||||
onInput={linkEvent(this, this.handleLoginTotpChange)}
|
||||
/>
|
||||
</div>
|
||||
|
@ -184,12 +184,12 @@ export class Login extends Component<any, State> {
|
|||
let lForm = i.state.form;
|
||||
let username_or_email = lForm.username_or_email;
|
||||
let password = lForm.password;
|
||||
let totp_token = lForm.totp_token;
|
||||
let totp_2fa_token = lForm.totp_2fa_token;
|
||||
if (username_or_email && password) {
|
||||
let form: LoginI = {
|
||||
username_or_email,
|
||||
password,
|
||||
totp_token,
|
||||
totp_2fa_token,
|
||||
};
|
||||
WebSocketService.Instance.send(wsClient.login(form));
|
||||
}
|
||||
|
@ -201,7 +201,7 @@ export class Login extends Component<any, State> {
|
|||
}
|
||||
|
||||
handleLoginTotpChange(i: Login, event: any) {
|
||||
i.state.form.totp_token = event.target.value;
|
||||
i.state.form.totp_2fa_token = event.target.value;
|
||||
i.setState(i.state);
|
||||
}
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ interface SettingsState {
|
|||
show_read_posts?: boolean;
|
||||
show_new_post_notifs?: boolean;
|
||||
discussion_languages?: number[];
|
||||
generate_totp?: boolean;
|
||||
generate_totp_2fa?: boolean;
|
||||
};
|
||||
changePasswordForm: {
|
||||
new_password?: string;
|
||||
|
@ -857,7 +857,7 @@ export class Settings extends Component<any, SettingsState> {
|
|||
|
||||
totpSection() {
|
||||
let totpUrl =
|
||||
UserService.Instance.myUserInfo?.local_user_view.local_user.totp_url;
|
||||
UserService.Instance.myUserInfo?.local_user_view.local_user.totp_2fa_url;
|
||||
|
||||
return (
|
||||
<>
|
||||
|
@ -868,7 +868,7 @@ export class Settings extends Component<any, SettingsState> {
|
|||
className="form-check-input"
|
||||
id="user-generate-totp"
|
||||
type="checkbox"
|
||||
checked={this.state.saveUserSettingsForm.generate_totp}
|
||||
checked={this.state.saveUserSettingsForm.generate_totp_2fa}
|
||||
onChange={linkEvent(this, this.handleGenerateTotp)}
|
||||
/>
|
||||
<label className="form-check-label" htmlFor="user-generate-totp">
|
||||
|
@ -892,7 +892,7 @@ export class Settings extends Component<any, SettingsState> {
|
|||
id="user-remove-totp"
|
||||
type="checkbox"
|
||||
checked={
|
||||
this.state.saveUserSettingsForm.generate_totp == false
|
||||
this.state.saveUserSettingsForm.generate_totp_2fa == false
|
||||
}
|
||||
onChange={linkEvent(this, this.handleRemoveTotp)}
|
||||
/>
|
||||
|
@ -1077,14 +1077,14 @@ export class Settings extends Component<any, SettingsState> {
|
|||
if (checked) {
|
||||
toast(i18n.t("two_factor_setup_instructions"));
|
||||
}
|
||||
i.state.saveUserSettingsForm.generate_totp = checked;
|
||||
i.state.saveUserSettingsForm.generate_totp_2fa = checked;
|
||||
i.setState(i.state);
|
||||
}
|
||||
|
||||
handleRemoveTotp(i: Settings, event: any) {
|
||||
// Coerce true to undefined here, so it won't generate it.
|
||||
let checked: boolean | undefined = !event.target.checked && undefined;
|
||||
i.state.saveUserSettingsForm.generate_totp = checked;
|
||||
i.state.saveUserSettingsForm.generate_totp_2fa = checked;
|
||||
i.setState(i.state);
|
||||
}
|
||||
|
||||
|
|
|
@ -5403,10 +5403,10 @@ leac@^0.6.0:
|
|||
resolved "https://registry.yarnpkg.com/leac/-/leac-0.6.0.tgz#dcf136e382e666bd2475f44a1096061b70dc0912"
|
||||
integrity sha512-y+SqErxb8h7nE/fiEX07jsbuhrpO9lL8eca7/Y1nuWV2moNlXhyd59iDGcRf6moVyDMbmTNzL40SUyrFU/yDpg==
|
||||
|
||||
lemmy-js-client@0.17.2-rc.2:
|
||||
version "0.17.2-rc.2"
|
||||
resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.17.2-rc.2.tgz#c2b045742c44992ec563c75a17cc1c7ebbb385eb"
|
||||
integrity sha512-Nsb0CnQ8JA8KlhDxb4Tri1QTT8l+4KMjbh17hBmMTjXzlSbo0xDyGBzF60Z2ffKu1ZPPll1ncO2tJeqCroin6w==
|
||||
lemmy-js-client@0.17.2-rc.3:
|
||||
version "0.17.2-rc.3"
|
||||
resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.17.2-rc.3.tgz#dc2a33e9228aef260b03a6e1f55698a2f975f979"
|
||||
integrity sha512-FlWEPMrW2Q/FbtihLOHq2YtcRuoX7700LweCnsm6R6dD6SzsnWy9nKJhn24fcjcR2o6tw0oZKgP0ccq9jPDgfQ==
|
||||
dependencies:
|
||||
node-fetch "2.6.6"
|
||||
|
||||
|
|
Loading…
Reference in a new issue