I'm currently working on adding multi-factor authentication to my SvelteKit app, but I've encountered an issue.
I'm not sure how to handle the situation when a user leaves or refreshes the site before completing the verification of the MFA challenge by scanning the QR code and inputing the verification code for enrollment. In my code, I need a way to determine whether the user has left or refreshed the site before successfully verifying the MFA challenge. The problem is that when I call the enroll function to add another factor, it doesn't automatically remove the previous unscanned factor. So, I'm looking for an effective way to handle this situation and detect if the enrollment process has failed. Could anyone please provide some guidance on how to approach this?