Skip to content

Instantly share code, notes, and snippets.

const registerUser = asyncHandler(async (req, res) => {
// get user details from FE
// validation of user - not empty, email, password
// check if user exists or not - username, email
// hash password
// check for images and avatar
// upload to cloudinary
// create user object - create user entry in db
// remove password and refresh token from response
// check if respose of user creation is success or not