In Question (2.20) of Griffiths' Quantum Mechanics book, they have given this Solution.
In the Solution of question 2.20(b), they omitted $e^{(ik-a) \infty}$ (or may have considered $e^{(ik-a) \infty}=0$) in this calculation
.
How can it be correct at all?
It's because $\lim_{x\to\infty}e^{ikx-ax}=0$. And this follows from the fact that$$\left|e^{ikx-ax}\right|=e^{\operatorname{Re}(ikx-ax)}=e^{-ax},$$together with the fact that$$\lim_{x\to\infty}e^{-ax}=0$$ for $a>0$.