Fix authentication security