Fix authentication management