The above solution is correct, but please note that you MIGHT need to add "use client" on top of this login.tsx page. Fouund out here: https://github.com/vercel/next.js/discussions/59483