Find the general solution to $\csc \theta + \sec \theta = 1$ 
Find the general solution to $$\csc\theta + \sec\theta =1$$

This is how I solved.
We have, 
\begin{align}
\csc\theta + \sec\theta &=1\\
\frac1{\sin\theta} + \frac1{\cos\theta}& =1\\
\frac{\sin\theta+\cos\theta}{\sin\theta\cos\theta} &=1\\
(\sin\theta + \cos\theta)^2 &= (\sin\theta\cos\theta)^2 \\
1 + 2\sin\theta\cos\theta &= \frac{4\sin^2\theta\cos^2\theta}4\\
1 + \sin2\theta &= \frac{(2\sin\theta\cos\theta)^2 }4\\
4 + 4\sin2\theta &= \sin^2 2\theta\\
\sin^2 2\theta - 4\sin2\theta - 4 &= 0\\
\sin2\theta &= 2 - 2\sqrt2\end{align}
Now here I am stuck. Can someone please help me proceed further? 

Hint
Again avoid squaring as it immediately introduces 
When do we get extraneous roots?
$\sin x\cos x=\sin x+\cos x=y,$
$y=\sqrt2\cos(x-45^\circ)\implies-\sqrt2\le y\le?$(say)
$$y^2=1+2\sin x\cos x$$
Let $y^2-1=2y\iff y^2-2y-1=0$
$y=1\pm\sqrt2$
$\implies y=1-\sqrt2$
$\implies\cos(x-45^\circ)=\dfrac1{\sqrt2}-1$
