private function resetAuthenticationKey(AuthenticationRecordInterface $auth): AuthenticationRecordInterface
    {
        $key = KeyFactory::generateEncryptionKey();
        $auth->setSessionKey($key->getRawKeyMaterial());
        $this->authenticationProvider->update($auth);

        return $auth;
    }