how to verify me One Time Password? (i'm making login logic)
User needs to insert Name , Email and then One time password which will be sent on his Email . how to make this one time password verification logic? any ideas? (probably i will use this Email sender for many purposes , Email confirmation and etc.)
thats what my sender looks like :
6 Replies
What do you do after validating the email ?
i'll mark it like approved email (i'll do that in future) and then make logic which needs approved email (Like email password restoring and smth like that)
my main task for now is to find good way how to store and validate one time password , i can store it in database or user cache , like IMemoryCache) (any tip will help cuz i'm lowskill rn)
If you have more than one instance of server where you backend is running then MemoryCache is not correct choice
Redis can be used in that case. And the verification email should be shortlived as well
If it's long time (more than 8hrs maybe) then I would use database
it's small asp.net + blazor wasm project
one time password lifetime is few minutes
Okay if it's one instance then in-memory is fine
thanks