Refactor login initialization logic to remove unused configuration check for bd_vid and simplify OAuth visibility condition. (#5283)