Handling Verification Code using nodejs and mongoose

What is the best way to compare or authenticate user after registration using 6 digit code sent to his email. How can i compare the two code in the backend?!

what i did is temporary save the code in the mongodb then veirify from the frontend, but it seems there are a lot more better ways than this.

Please advise!
Thanks!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.