Can anyone take a look to see if my argument in this proof is correct?

Show that has no solution in integer if , , p is prime.

Argue by contradiction, suppose that the Pell's equation does have an integer solution. Rewrite the equation since . So, has a solution. This is a contradiction because if then the Legendre symbol implying the above congruence is not solvable.