Gandi only remembers you’re logged in for the current session. The solution I came up with was a userscript, Gandi 2-step fixer, which generates the code on-the-fly and automatically fills it in when Gandi requests it. It requires storing your secret (which you can extract from the QR code if you kept it) in the file. I suppose you could
prompt() for it instead, but if you encrypt your hard disks then you’ll be fine storing it in a file.
I’ve since discovered Authy, which makes my userscript less useful, though personally I still use it as it takes away the manual step.