If $\cos \theta \neq 0$ and $\sec \theta-1=(\sqrt{2}-1) \tan \theta$
$\Rightarrow \frac{1-\cos \theta}{\cos \theta}=(\sqrt{2}-1) \frac{\sin \theta}{\cos \theta}$
$\Rightarrow 2 \sin ^{2} \frac{\theta}{2}=(\sqrt{2}-1) 2 \sin \frac{\theta}{2} \cos \frac{\theta}{2}$
$\Rightarrow $ Either $\sin \frac{\theta}{2}=0$ or $\tan \frac{\theta}{2}=\sqrt{2}-1$
$\Rightarrow $ Either $\frac{\theta}{2}=n \pi, n \in Z$
or $\frac{\theta}{2}=n \pi+\frac{\pi}{8}, n \in Z$
$\Rightarrow \theta=2 n \pi+\frac{\pi}{4}$
or $2 n \pi,\, n \in Z$