Fix auto-logout after scan a QR

fixes #2121