Being asked for the emailed code every time means Discord is not keeping its session, and that is nearly always cookies or cache. Do not use it in a private window, and make sure your browser is not set to clear cookies on close. If it is the desktop app, quit it from the tray, clear the Discord cache folder, and reopen. A VPN that keeps changing your IP can also make Discord re-verify each login.
Discord does this when it cannot keep its session cookie, usually a privacy extension or a clear-cookies-on-close setting. Whitelist discord.com, and if you use a VPN that hops IPs, that can trip its security checks and force re-logins too.