'Global control function for two factor authentication
In my users collection I have the information about two factor authentications as tfa_status. And I have clients who wants their users to have activated their two factor authentications. And the information about if they want it, is stored in another collection.
There are so many functions, where I need to check if the client wants two factor authentication and if yes, I need to check if the user has activated their two factor authentication. So I wanted to ask, if there is a way I can make one global function and use it in all the other functions where I need to check.
I'm using fastify and mongo.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
