diff --git a/nobilis b/nobilis index 3a5b747..c3c399d 160000 --- a/nobilis +++ b/nobilis @@ -1 +1 @@ -Subproject commit 3a5b74740138b6c7eddf6435431686f64ff6276e +Subproject commit c3c399dc2bd71ca37a47666efba238d83d1ba9b3 diff --git a/src/renderer/src/components/AccountsPanel.tsx b/src/renderer/src/components/AccountsPanel.tsx index 86f122e..5044c0e 100644 --- a/src/renderer/src/components/AccountsPanel.tsx +++ b/src/renderer/src/components/AccountsPanel.tsx @@ -950,11 +950,9 @@ function DiscordForm({ accountId }: { accountId?: string }): JSX.Element { const store = useStore() const qrPath = useChat((s) => s.discordQrPath) const status = useChat((s) => s.discordLoginStatus) - const mfa = useChat((s) => s.discordMfa) const [method, setMethod] = useState<'qr' | 'browser'>('qr') // No password state any more, deliberately: the password is typed into // Discord's own page in the sign-in window, so this process never holds one. - const [code, setCode] = useState('') const [busy, setBusy] = useState(false) // Only for a new account: re-authenticating keeps the account's own setting. const [useTor, setUseTor] = useState(false) @@ -965,65 +963,6 @@ function DiscordForm({ accountId }: { accountId?: string }): JSX.Element { setBusy(false) } - // The two-factor step replaces the form: the login is already in flight and - // only needs the code to finish. - if (mfa) { - return ( -
- {mfa.totp - ? 'Enter the 6-digit code from your authenticator app.' - : 'Enter your verification code.'} - {mfa.backup && ' A backup code works here too.'} -
-{status}
} -- Opens Discord's own sign-in page in a browser window. Your password goes into - their form and never passes through moho — and because it is their page, their - captcha, two-factor and device checks all work normally. The window is thrown away - afterwards, session and all. + Sign in with your email or phone and password on Discord's own page, in a window + moho opens. Your password goes into their form and never passes through moho — and + because it is their page, their captcha, two-factor and new-device checks all work as + they do anywhere. The window is thrown away afterwards, session and all.
> )} diff --git a/src/renderer/src/state/store.ts b/src/renderer/src/state/store.ts index cc3476f..8ac21ee 100644 --- a/src/renderer/src/state/store.ts +++ b/src/renderer/src/state/store.ts @@ -637,8 +637,6 @@ export interface ChatState { // Login flows discordQrPath: string discordLoginStatus: string - /** Set when a Discord password login stops at the two-factor step. */ - discordMfa: { loginId: string; totp: boolean; sms: boolean; backup: boolean } | null /** The account being re-authenticated, or '' for a brand-new one. */ discordReauthAccountId: string sneedChatLoginStatus: string @@ -727,7 +725,6 @@ const INITIAL: ChatState = { matrixVerification: null, discordQrPath: '', discordLoginStatus: '', - discordMfa: null, discordReauthAccountId: '', sneedChatLoginStatus: '', matrixLoginStatus: '' @@ -3278,24 +3275,12 @@ export class ChatStore { case 'discordLoginScanned': this.set({ discordLoginStatus: 'Scanned - approve it on your phone' }) break - case 'discordLoginMfa': - this.set({ - discordMfa: { - loginId: data.loginId, - totp: !!data.totp, - sms: !!data.sms, - backup: !!data.backup - }, - discordLoginStatus: '' - }) - break case 'discordLoginResult': this.set({ discordQrPath: '', discordLoginStatus: data.error || '', // A failure leaves the form open to try again; success clears it. - discordMfa: data.error ? this.state.discordMfa : null, discordReauthAccountId: data.error ? this.state.discordReauthAccountId : '' }) if (!data.error) { @@ -4538,14 +4523,10 @@ export class ChatStore { this.set({ discordReauthAccountId: accountId, discordQrPath: '', - discordLoginStatus: '', - discordMfa: null + discordLoginStatus: '' }) } - clearDiscordMfa(): void { - this.set({ discordMfa: null }) - } setSneedChatLoginStatus(status: string): void { this.set({ sneedChatLoginStatus: status }) }