fix(auth): a password set up for good stays, through resets too
`password.set` replaced a password whenever the account had no confirmed authenticator, which is also the state an authenticator's or the account's reset leaves behind; and in that state a code by mail or GitHub signed in again. So whoever got a session another way could replace the password and the keys, skipping the reset's 72 hours. An account had a confirmed authenticator while it has one or a reset of it stands (`hadConfirmedAuthenticator`: the reset's row stays until a new authenticator is confirmed). Then `password.set` is refused (`passwordExists`), and the account signs in with its password alone: codes by mail and GitHub are refused (`usePassword`), the latter through `SignInWays.passwordOnly`, which members read from the register. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
892fba97e8
commit
4e425cb17f
1 changed files with 167 additions and 19 deletions
|
|
@ -219,6 +219,8 @@ final class _Register implements AccountRegister {
|
|||
email: addresses.containsValue(person),
|
||||
password: passwords.contains(person),
|
||||
authenticator: authenticated.contains(person),
|
||||
passwordOnly:
|
||||
passwords.contains(person) && authenticated.contains(person),
|
||||
),
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue