[Web] OIDC/LDAP: check the OAuth state, keep the mailbox on token refresh, require unique IdP users

This commit is contained in:
FreddleSpl0it committed 2026-11-02 09:54:54 +01:00
1 parent 41467dc47f
commit 5eb3148bd5
5 files changed
+56 -10

No files matched your search

@@ -26,6 +26,17 @@ class SyncPlannerTest extends TestCase
$this->assertSame([], $plan->conflicts);
}
public function testUnlinkedMailboxWithSeveralIdpUsersIsNeitherLinkedNorOffboarded(): void
{
$users = [self::user('u1', 'a@example.org'), self::user('u2', 'a@example.org', false), self::user('u3', 'a@example.org')];
$plan = $this->plan($users, [new Account('a@example.org', 'A', 1)]);
$this->assertSame([], $plan->links);
$this->assertSame(['Several IdP users have the email a@example.org'], $plan->conflicts);
$this->assertSame([], $plan->missing);
$this->assertSame([], $plan->deactivate);
}
public function testLinkedUserWithNewEmailIsAConflictAndNotCreated(): void
{
$plan = $this->plan([self::user('u1', 'new@example.org')], [new Account('a@example.org', 'A', 1, 'u1')]);