Updated one-time sign on database function