So I have a small confusion when normalising an infinite well wave-function. The wave-function for my problem is $$Ψ(x) = Ae^{i(kx-wt)}+Be^{-i(kx-wt)}+Ce^{i(kx-wt)}+De^{-i(kx-wt)}.\tag{1}$$
Applying the boundary conditions at $x = 0$ and at $x = L$, considering the quantised energy formulae for the function's arguments (and with some reasoning) I end up with the wave-function $$\psi_{n} = 2iA\sin\Big(\frac{n\pi x}{L}\Big)e^{-i\omega_{n}t}$$
To normalise it I take the probability density of the wave-function by considering the conjugate of the wave-function as well. For the sake of integration let's consider the dummy variable x' $$\int_{x'=0}^{x'=L} \psi_{n}^{*}(x',t)\psi_{n}(x',t)~dx'=1$$
Doing the manipulation and integral etc. I end up with $$2|A|^{2}L=1.$$ The $$|A|^{2}$$ is due to the complex conjugate of the wave-function, since $$A^{*}A=|A|^{2}$$
Then, $$|A| = \frac{1}{\sqrt{2L}}$$
Then, my professor claims that $$A = \frac{e^{i\phi}}{\sqrt{2L}}$$ where $$\phi$$ is an undetermined phase which in our case we arbitrarily choose as -π/2 as it gives a spatially real wave-function. Finally, the wave-function becomes as $$\psi_{n} = \sqrt{\frac{2}{L}}\sin(\frac{n\pi x}{L})e^{-i\omega_{n}t}$$
Here comes the question. How did my professor pull out that exponential when transitioning from |A| to A.