Absolute values of two functions and absolute values of their Fourier transform coincides

Let $f, g in L^2(mathbb{R})$.

Is it true that if both $|f|=|g|$ and $|hat f|=|hat g|$ hold, then there exists $theta in mathbb{R}$ such that $f=ge^{itheta}$?

I am not able to prove it or disprove it. I suspect that this is true.