Feb. 28, 2024, 5:47 p.m. | FredAbod

DEV Community dev.to




Hashing Password And Generating User Token In Your Schema


Let's dive right into it



I know you must be asking yourself, Why Do we need to Hash our Password in the schema rather than doing it in our controller logic or the routes?

I'll give you very simple answers:



  1. If you need to hash Password in a couple of places in your code this Is a better approach

  2. If you need to assign a token in more than one route …

asking controller dive doing hash hashing javascript logic mongodb node password programming routes simple token

Sr Security Engineer - Colombia

@ Nubank | Colombia, Bogota

Security Engineer, Investigations - i3

@ Meta | Menlo Park, CA | Washington, DC | Remote, US

Cyber Security Engineer

@ ASSYSTEM | Bridgwater, United Kingdom

Security Analyst

@ Northwestern Memorial Healthcare | Chicago, IL, United States

GRC Analyst

@ Richemont | Shelton, CT, US

Security Specialist

@ Peraton | Government Site, MD, United States