Refine loginURL