PureCode Software interview question

How do you implement user authentication in a MERN stack application? Can you discuss the pros and cons of using JWT (JSON Web Tokens) versus sessions?