Let $X$ be a path-connected manifold. Then by the classification of vector bundles, the collection of all (real) line bundles on $X$ is $$ \text{Vect}^1(X)\cong [X,BO(1)]=[X,\mathbb{R}P^\infty]=[X,B\mathbb{Z}_2] $$ where $\mathbb{Z}_2=\{\pm 1\}$ under multiplication.
Question. Are there any results/references giving that
$$ \text{Vect}^1(X)\cong \text{Hom}(\pi_1(X), \mathbb{Z}_2)? $$ Whether can we just take loop space $$ [X,B\mathbb{Z}_2]=[\Omega X,\Omega B\mathbb{Z}_2] =[\pi_1(X), \mathbb{Z}_2] $$ or not?