I have a problem in section 3 in “Authentication and Authorization”, when I try to create a user with invalid email like Mosh tried himself.
Someone know why it’s doesn’t work for me?
This is the error then occured in my terminal:
“(node:11412) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead.
(Use node --trace-deprecation ...
to show where the warning was created)
Connected to MongoDB…
SyntaxError: Unexpected token S in JSON at position 11
at JSON.parse ()
at parse (C:\Users\SharelShalom\Desktop\COMPUTER\nodeCourse\vidly\node_modules\body-parser\lib\types\json.js:89:19)
at C:\Users\SharelShalom\Desktop\COMPUTER\nodeCourse\vidly\node_modules\body-parser\lib\read.js:121:18
at invokeCallback (C:\Users\SharelShalom\Desktop\COMPUTER\nodeCourse\vidly\node_modules\raw-body\index.js:224:16)
at done (C:\Users\SharelShalom\Desktop\COMPUTER\nodeCourse\vidly\node_modules\raw-body\index.js:213:7)
at IncomingMessage.onEnd (C:\Users\SharelShalom\Desktop\COMPUTER\nodeCourse\vidly\node_modules\raw-body\index.js:273:7)
at IncomingMessage.emit (events.js:327:22)
at endReadableNT (internal/streams/readable.js:1327:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21)”