added support for 2fa login with browser flow

This commit is contained in:
2026-08-10 20:00:38 +02:00
parent 889d8f67c5
commit ccb22a497d
13 changed files with 805 additions and 35 deletions
@@ -53,6 +53,45 @@ void main() {
});
});
group('registrationTypesFor', () {
test('password accounts maintain both registrations', () {
expect(
PushRegistration.registrationTypesFor(
usesLoginFlow: false,
hasTalkAppPassword: false,
),
PushRegistrationType.values,
);
expect(
PushRegistration.registrationTypesFor(
usesLoginFlow: false,
hasTalkAppPassword: true,
),
PushRegistrationType.values,
);
});
test('flow account without talk app password is talk-only', () {
expect(
PushRegistration.registrationTypesFor(
usesLoginFlow: true,
hasTalkAppPassword: false,
),
[PushRegistrationType.talk],
);
});
test('flow account with second (talk) app password maintains both', () {
expect(
PushRegistration.registrationTypesFor(
usesLoginFlow: true,
hasTalkAppPassword: true,
),
PushRegistrationType.values,
);
});
});
group('pushTokenVariant', () {
test('general uses the raw token, talk appends the suffix', () {
expect(pushTokenVariant('tok', PushRegistrationType.general), 'tok');