Assume that the integer $r$ is a primitive root of the prime $p$, where $p \equiv 1 \pmod{8}$. Show that the solutions of the quadratic congruence $x^2 \equiv 2\pmod{p}$ are given by $x \equiv \pm (r^{7(p-1)/8}+r^{(p-1)/8}) \pmod{p}$
Here is my attempt so far
$$r \text{ is a primitive root } \implies \exists k: 2\equiv r^k \pmod{p}$$ I am not sure why the question is assuming the given quadratic congruence always has a solution. But if it has a solution, from Euler's criterian we have $$2^{(p-1)/2}\equiv 1\pmod{p}$$
I feel stuck at this point.. Any help is appreciated thanks!