{
    "componentChunkName": "component---src-templates-blog-post-js",
    "path": "/implement-jwt-based-user-authentication-in-a-mern-stack-app-part-2/",
    "result": {"data":{"markdownRemark":{"html":"<h6 id=\"this-blog-post-is-part-of-a-series-you-must-finish-part-1-before-continuing-here\" style=\"position:relative;\"><a href=\"#this-blog-post-is-part-of-a-series-you-must-finish-part-1-before-continuing-here\" aria-label=\"this blog post is part of a series you must finish part 1 before continuing here permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>This blog post is part of a series. You must finish <a href=\"https://hemanta.io/implement-jwt-based-user-authentication-in-a-mern-stack-app-part-1/\">part-1</a> before continuing here.</h6>\n<h3 id=\"full-stack-application-structure\" style=\"position:relative;\"><a href=\"#full-stack-application-structure\" aria-label=\"full stack application structure permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Full-stack application structure</h3>\n<p>There are many ways you can structure a full-stack application. The structure that we are going to create below is the one that I use in all my projects.</p>\n<blockquote>\n<p>I created this application on windows. However, you should have no problem following the instructions on macOS.</p>\n</blockquote>\n<p>Create a folder named <del>mern-auth</del> and open it in Visual Studio Code or any other code editor of your choice. By the way, if you have not tried VS code yet, I highly encourage you to give it a try.</p>\n<p>You can open an integrated terminal inside VS code using the keyboard shortcut <del>Ctrl+`</del> (<em>with the backtick character</em>). This is convenient as you don’t have to switch between windows.</p>\n<p>Inside <del>mern-auth</del>, create a React project called <del>client</del>.</p>\n<pre class=\"grvsc-container synthwave-84\" data-language=\"sh\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"grvsc-source\"><span class=\"mtk1\">PS C:</span><span class=\"mtk6\">\\U</span><span class=\"mtk1\">sers</span><span class=\"mtk6\">\\D</span><span class=\"mtk1\">elhivery</span><span class=\"mtk6\">\\D</span><span class=\"mtk1\">esktop</span><span class=\"mtk6\">\\m</span><span class=\"mtk1\">ern-auth</span><span class=\"mtk10\">&gt;</span><span class=\"mtk1\"> npx create-react-app client</span></span></span></code></pre>\n<blockquote>\n<p>If you have previously installed <del>create-react-app</del> globally via <del>npm install -g create-react-app</del>, it is recommended that you uninstall the package using <del>npm uninstall -g create-react-app</del> to ensure that npx always uses the latest version. npx comes with npm 5.2+ and higher.</p>\n</blockquote>\n<p>Next, inside <del>mern-auth</del>, create a folder named <del>server</del>.</p>\n<pre class=\"grvsc-container synthwave-84\" data-language=\"sh\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"grvsc-source\"><span class=\"mtk1\">PS C:</span><span class=\"mtk6\">\\U</span><span class=\"mtk1\">sers</span><span class=\"mtk6\">\\D</span><span class=\"mtk1\">elhivery</span><span class=\"mtk6\">\\D</span><span class=\"mtk1\">esktop</span><span class=\"mtk6\">\\m</span><span class=\"mtk1\">ern-auth</span><span class=\"mtk10\">&gt;</span><span class=\"mtk1\"> mkdir server</span></span></span></code></pre>\n<p>At this stage, inside <del>mern-auth</del>, we have two folders - <del>client</del> &#x26; <del>server</del>. What’s more, <del>create-react-app</del> has already initialized the <del>client</del> folder as a Git repository by default. If you <del>cd</del> into the <del>client</del> folder, you can see the <del>.git</del> sub-folder (<em>hidden</em>) using the following command:</p>\n<pre class=\"grvsc-container synthwave-84\" data-language=\"sh\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"grvsc-source\"><span class=\"mtk1\">PS C:</span><span class=\"mtk6\">\\U</span><span class=\"mtk1\">sers</span><span class=\"mtk6\">\\D</span><span class=\"mtk1\">elhivery</span><span class=\"mtk6\">\\D</span><span class=\"mtk1\">esktop</span><span class=\"mtk6\">\\m</span><span class=\"mtk1\">ern-auth</span><span class=\"mtk6\">\\c</span><span class=\"mtk1\">lient</span><span class=\"mtk10\">&gt;</span><span class=\"mtk1\"> ls -Fo</span></span></span></code></pre>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 524px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/fb0155f4ac39c745010599daa323b0b7/6d924/gitSubfolder.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 61.5%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAMCAIAAADtbgqsAAAACXBIWXMAAA7DAAAOwwHHb6hkAAABoklEQVQoz2WSaY7iMBCFOUdwYSfet2wOJhGJIKAmDFLuf50RuJtmNN8Pyy7l1XvleJPnuTU6L3IhpLHGWlsUhXPuOI1SSUCw2+0AnivGePcvG4QQ5zyE0Lat0rqu67Zt+74/HA7xhxBC8yKEQClNvZ5i/OLd+PP4WSeEkP+dtdYhhHczhJBzLsa43++bpkmZ27Z9BTlQShFCv2LOubWWEAIAjLGu64ZhSJsQwrc5IZLmp1g7yTDJ38M/nY0xhBCEkFJqnufb7UYpnaZpGIb0HQDkBP/5up6mMYTAKP0WqxdJbIy5XC7LslBKj8fjOI4p0Xa7LYri0PdKqTRaCr+hlKbYCCHv/el0Op/PnPO+77uuwxgDQFmWw4vLPMcYnXNCCADYMMa890nsnFuWZV1Xxtj1ep3nOdWbprnf74/HY13XaZqqqmKMPZ0JIYwxAMiyTAjhvXfOEUKUUlJKAEAIYYy11lVVNU0jhMiyLP2dZ2zGmPxBCCGlTErOeaoIIYwxGOM06u9tU0q11smwruuyLOu6TibOubIsvffW2hjj59tK4r/haXCY5bIRewAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\".git subfolder\"\n        title=\".git subfolder\"\n        src=\"/static/fb0155f4ac39c745010599daa323b0b7/6d924/gitSubfolder.png\"\n        srcset=\"/static/fb0155f4ac39c745010599daa323b0b7/56d15/gitSubfolder.png 200w,\n/static/fb0155f4ac39c745010599daa323b0b7/d9f49/gitSubfolder.png 400w,\n/static/fb0155f4ac39c745010599daa323b0b7/6d924/gitSubfolder.png 524w\"\n        sizes=\"(max-width: 524px) 100vw, 524px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n        decoding=\"async\"\n      />\n  </a>\n    </span></p>\n<p>We will also see a <del>.gitignore</del> file inside the <del>client</del> folder.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 186px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/4354b4c83b0635aa492bc41f1430a78e/d1752/gitIgnoreClient.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 131.72043010752688%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAaCAIAAAA44esqAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAEH0lEQVQ4y4XTW28bRRQHcIs2QrQp6htVKYk91/XsZfY+e/Hueu3ETrwbX9Z24ti5OCGkCaWtqASiSbmIB1C/AE88IfE9kYsoJCUg/TVvP52ZM+eUhKi5bs0P0k5ny4k37fmPUf8428j6/XG3N2q18+Z6Z1BsZ51enhedTj+Omo4T+l5iGG7J82IhorDWHPSHdrolnf8Sjp9Mtycnx59N9+bz47PdyXS6N5/tHc6PHs/2j5I4dd1IiHiBVc1QVEM3bN10bMvWNIMbtqZbGjdVzUzTlqJwL4g9P2QyN01X4wbXbT+IZFktWarimfrx4f6Lz09fnJ/uDLsn+9PZ9uhoPshba0U7txnbrDfGnU1brg6yzNWqkeud7R6quFJa8bceeflqVIBktBL2H4jsod+DSVGO++VoQBq7sFasBH3amDwSGayPV4JuOeyjdOdjs1F6v/vtB73vywevH+z+3Pvh9+blb41vfl3OL291Lpayi9udl7ezy6X84lbn5VL+6nbn5VJ2uZRdvJe9utt6Vvpw4/m99vOHg68/6n7ln/7knb3mh9/dbz+9s/7F3b9yZ+3JcuvZcuvpvfabs/V0eePL+/WjElRMIJtE95gZrFQNoNhYD6qmJxk+swLFDpnlq25EuANk8+8oVkVSSxQjiqCmqMKyDc6baT2t1+PQD/wgDoIkCqNaba3RtA0NAUAQfBsEQYkQiRBJllWMKQCwAhAhEqUSQhhhgjBFmECEMabXAiEuEUIxJhrXfeHXwnQ2PTz59PRgZ6brBlwgclMgRAtMCFVkBSHMVd3QdZ3rOueSJBFEyP9ijElV4aZpK9yoJSnE9JNVUIEYIAIQgehmjAmVJVq31dTW2rHYyVs+pzaDDkMOg56CefXf/QIDTH2NxI7GVaYS6Ohq5FoOV4ShuYbm69VIW9QnN+FAxcIVku5YInx8fjadzA6mh4NiNNmZraWRJ0OIKFlwSq5hiKmj0rbLYh3FhhRxHCiwblVdaVWwSqxBT4blCgIAAgD/2f8FppRWAE3b+qCoChGNx5NhUYx3tkfF9kZ7M+90B8PRcDDebG30ikES1SCAV78KU91QNA2bhlur1SzLEp6/1lzniz/TbccOa1EcxcLzdK7hxcC8xZQiRINYW1uvqqoe+GESx0mSCEf4fuAILwwirqnlchlUwPVrE7LAYaw2GygM0slkdyvrDMej6WQ2GA6zrW437wfCQQj/ORHvTBgmjDtQthmTZSZLEqtSpmqcyexNkwmm0tvbXsVUwgBYjS2lWSRJ83h+vDvdG+ejg4OD4fYg38gn033hCVCBN1QmRGIKoqy8WsaYAAAprVJCZVlmVcaYco1dnW0iecIzLbvX7W5meVEMTV0HEC22chGE0H8sxqKIomo8iWMvCOM4lpmM3nnku/gPLtU/PI6hRFsAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\".gitignore file\"\n        title=\".gitignore file\"\n        src=\"/static/4354b4c83b0635aa492bc41f1430a78e/d1752/gitIgnoreClient.png\"\n        srcset=\"/static/4354b4c83b0635aa492bc41f1430a78e/d1752/gitIgnoreClient.png 186w\"\n        sizes=\"(max-width: 186px) 100vw, 186px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n        decoding=\"async\"\n      />\n  </a>\n    </span></p>\n<p>Because we are building a full-stack application, we want to initialize the root folder (<del>mern-auth</del>) as a Git repository, not the <del>client</del> folder.</p>\n<p>Therefore, we have to uninitialize the <del>client</del> folder as a Git repository by removing the <del>.git</del> sub-folder inside it. We can to do so using the following command:</p>\n<pre class=\"grvsc-container synthwave-84\" data-language=\"sh\" data-index=\"3\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"grvsc-source\"><span class=\"mtk1\">PS C:</span><span class=\"mtk6\">\\U</span><span class=\"mtk1\">sers</span><span class=\"mtk6\">\\D</span><span class=\"mtk1\">elhivery</span><span class=\"mtk6\">\\D</span><span class=\"mtk1\">esktop</span><span class=\"mtk6\">\\m</span><span class=\"mtk1\">ern-auth</span><span class=\"mtk6\">\\c</span><span class=\"mtk1\">lient</span><span class=\"mtk10\">&gt;</span><span class=\"mtk1\"> rm ./.git -Force</span></span></span></code></pre>\n<p>After executing the command, you will receive the following prompt.</p>\n<pre class=\"grvsc-container synthwave-84\" data-language=\"sh\" data-index=\"4\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"grvsc-source\"><span class=\"mtk1\">Confirm</span></span></span>\n<span class=\"grvsc-line\"><span class=\"grvsc-source\"><span class=\"mtk1\">The item at C:</span><span class=\"mtk6\">\\U</span><span class=\"mtk1\">sers</span><span class=\"mtk6\">\\D</span><span class=\"mtk1\">elhivery</span><span class=\"mtk6\">\\D</span><span class=\"mtk1\">esktop</span><span class=\"mtk6\">\\m</span><span class=\"mtk1\">ern-auth</span><span class=\"mtk6\">\\c</span><span class=\"mtk1\">lient</span><span class=\"mtk6\">\\.</span><span class=\"mtk1\">git has children and the Recurse parameter was not specified. If you continue, all children will</span></span></span>\n<span class=\"grvsc-line\"><span class=\"grvsc-source\"><span class=\"mtk1\">be removed with the item. Are you sure you want to continue</span><span class=\"mtk10\">?</span></span></span>\n<span class=\"grvsc-line\"><span class=\"grvsc-source\"><span class=\"mtk1\">[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [</span><span class=\"mtk10\">?</span><span class=\"mtk1\">] Help (default is </span><span class=\"mtk16\">&quot;Y&quot;</span><span class=\"mtk1\">):</span></span></span></code></pre>\n<p>Type <del>Y</del> and hit enter. The <del>.git</del> subdirectory will be deleted.</p>\n<p>Next, move the <del>.gitignore</del> file from the <del>client</del> folder to the <del>mern-auth</del> folder.</p>\n<p>Inside the <del>.gitignore</del> file, change <del>/node_modules</del> to <del>**/node_modules</del>. This will ensure that the <del>node_modules</del> folder in the current folder and all the sub-folders will be ignored.</p>\n<p>Now, generate a <del>package.json</del> file inside the <del>mern-auth</del> folder using the following command:</p>\n<pre class=\"grvsc-container synthwave-84\" data-language=\"sh\" data-index=\"5\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"grvsc-source\"><span class=\"mtk1\">PS C:</span><span class=\"mtk6\">\\U</span><span class=\"mtk1\">sers</span><span class=\"mtk6\">\\D</span><span class=\"mtk1\">elhivery</span><span class=\"mtk6\">\\D</span><span class=\"mtk1\">esktop</span><span class=\"mtk6\">\\m</span><span class=\"mtk1\">ern-auth</span><span class=\"mtk10\">&gt;</span><span class=\"mtk1\"> npm init -y</span></span></span></code></pre>\n<p>The <del>package.json</del> file is the manifest for our project and will include all the packages that our application depends on. You can generate a <del>package.json</del> file without having it ask you any questions with a <del>-y</del> flag.</p>\n<p>Now, your folder structure should look like the following:</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 198px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/bba5818dde12464d1a6012ed25d67d39/c7176/folderStructure.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 162.12121212121212%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAgCAYAAAASYli2AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAEyElEQVRIx5WW23LiRhCGeY4U5iAJSQidz5yEAIHBIAsbh12vd5PsbirJRZJKbvI+edIvJdlmdwu8SS66ekYz80/39N/dqklSh263h++HeK6H47iEYYTjOJRrnY78opTrsqyiKt3jvCaKEpbtsdnkLLKMxfKSIr9mOp0+HVCOm08BJTTNwDZtFFn5BCgIIvV6nXr9gkajSb3e4KLeoNVsc3HRpN0WvwpaYjyv1XTdeLTwasvVdstsvmC5yLhcr5kuMoo8ZxBHCIJ0xu3TC2rlm/lBzC7fsSsKtutLdtdbtkXObJnx8OpAmoxotdpHK78mNdv2cd2IIIjRwhnW6qGax9GIMBziuBFRNCKKhtV3z4vxvOhp/Kg/H9fiOCGdrbl//Qbz8Bf2n3/z6vDAH7//yYf3P/Hh4898+PALt7ffEoVjoiippN+fHHW/n1LilOOaaTqUousWtu3RcwcYho1huvh+hGW5lYWlB4bp0O+PCcM+puURBP3qTHne80IcJ6DmWBaTdMofv/3Kxx/e8/HtgZtix7v717x9/4Zx0icbLVjN5qiSxOv9Pdl4jCorbJZrHFNH13S+P7zD0w1qHbuP7I2whxl6lNILExR3iDmY0osnKN6QXpBi9zMkK0R1JxhhimCEWIM5stNHdsfE6Zq2P6PWlhQMO0A3HWbLnM22YJXf4Ho+TUFGUjREpYsgq0hKr9LtjoqoaI9a7iIoPdrNBt+MbqlJooTW1eiqKkEQMYhjwiCgqyi0Wy1azSatZquSZqOBKIjIJf8kiY70pDsySuuCerylVk7agohl2ehaD88LiAdDRkmK4/qMRwnDccJ0ljKdZlimUWVGxcmjKMitBvV+/ggoih0Mw8I0TLJsyWp9Rba8ZJzMuN5cs9lu2eYbNpuCMPCrVP0i/SrAi0+AJcM1rUdX7aIo3YoGcRijqSoXFw2apbvNVpXnz2Cf5/UJoCBK2LZL6IfcXN+xv33Ndw/fEXo+4lPFeZZzReKshYqiHg+Ionji1kv18LyFglgFw3N9dvsDw8EAQRSPF/xvwMeqXbokP4JIneqS8t1KBjzXzGfdbgufIl1WmS8ApQ5iR+Z6r5EmBqvLHbe3N9zd7TkcXrFaLLlarij2e/J1wWZ1SV7k+H7wKUCnFsqYloyha1URKPtJGaTxeIJjO+g9Hcu2q7XRcIDn+xUrzrtcWijJrLYa/biUCfP5nMViwSRJGY8ThqMx6TjFcSwajdbR/fMul1GVOgxHEqGvk83XZPM503nGbrdjPlswK+fJlMD3qr1fDUr1UVaR/Rmq6dGvWmhA5IcM+kOCKMSyHPwgRO1qR8te5mFlsoo+2WI89Zbt5obdJmdf3HJ9W7BarLgubjAt+yw/TyxU1W5VbZ55Jz/12Io2bfFIlaOLX8uUcrNlO7iOyyYv+HZ/w939A1k6QWifkvtsbz55w45SlaHyfcpfi8+b94k1/wZY5q3px6i6SZotef/jT7y5O7AvCm52+4o+UnWR8uK/zhkLVQSxU7lumia+F6B1y3fVKinLVqslfNHoXwRstTtcbjWyeZfRYMZ6vWazuWJ9teEyW5LO5qyXa5Lx6CxlToMidvACBc9VSScLprMZSZKyzXOy+aJqsZNRUvWZ/+LyP/a/5gf1kpo2AAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"full-stack folder structure\"\n        title=\"full-stack folder structure\"\n        src=\"/static/bba5818dde12464d1a6012ed25d67d39/c7176/folderStructure.png\"\n        srcset=\"/static/bba5818dde12464d1a6012ed25d67d39/c7176/folderStructure.png 198w\"\n        sizes=\"(max-width: 198px) 100vw, 198px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n        decoding=\"async\"\n      />\n  </a>\n    </span></p>\n<p>Let’s also initialize the <del>mern-auth</del> folder as a Git repository.</p>\n<pre class=\"grvsc-container synthwave-84\" data-language=\"sh\" data-index=\"6\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"grvsc-source\"><span class=\"mtk1\">PS C:</span><span class=\"mtk6\">\\U</span><span class=\"mtk1\">sers</span><span class=\"mtk6\">\\D</span><span class=\"mtk1\">elhivery</span><span class=\"mtk6\">\\D</span><span class=\"mtk1\">esktop</span><span class=\"mtk6\">\\m</span><span class=\"mtk1\">ern-auth</span><span class=\"mtk10\">&gt;</span><span class=\"mtk1\"> git init</span></span></span></code></pre>\n<p>I highly recommend that you push the local repository to a remote repository such as GitHub and do commits at regular intervals.</p>\n<p>Our application structure is now ready.</p>\n<p>Go to <a href=\"https://hemanta.io/implement-jwt-based-user-authentication-in-a-mern-stack-app-part-3/\">part-3</a></p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    position: relative;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n    line-height: 1.4;\n  }\n  \n  .grvsc-code {\n    display: table;\n  }\n  \n  .grvsc-line {\n    display: table-row;\n    box-sizing: border-box;\n    width: 100%;\n    position: relative;\n  }\n  \n  .grvsc-line > * {\n    position: relative;\n  }\n  \n  .grvsc-gutter-pad {\n    display: table-cell;\n    padding-left: 0.75rem;\n    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);\n  }\n  \n  .grvsc-gutter {\n    display: table-cell;\n    -webkit-user-select: none;\n    -moz-user-select: none;\n    user-select: none;\n  }\n  \n  .grvsc-gutter::before {\n    content: attr(data-content);\n  }\n  \n  .grvsc-source {\n    display: table-cell;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-source:empty::after {\n    content: ' ';\n    -webkit-user-select: none;\n    -moz-user-select: none;\n    user-select: none;\n  }\n  \n  .grvsc-gutter + .grvsc-source {\n    padding-left: 0.75rem;\n    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);\n  }\n  \n  /* Line transformer styles */\n  \n  .grvsc-has-line-highlighting > .grvsc-code > .grvsc-line::before {\n    content: ' ';\n    position: absolute;\n    width: 100%;\n  }\n  \n  .grvsc-line-diff-add::before {\n    background-color: var(--grvsc-line-diff-add-background-color, rgba(0, 255, 60, 0.2));\n  }\n  \n  .grvsc-line-diff-del::before {\n    background-color: var(--grvsc-line-diff-del-background-color, rgba(255, 0, 20, 0.2));\n  }\n  \n  .grvsc-line-number {\n    padding: 0 2px;\n    text-align: right;\n    opacity: 0.7;\n  }\n  \n  .synthwave-84 { background-color: #262335; }\n  .synthwave-84 .mtk1 { color: #FFFFFF; }\n  .synthwave-84 .mtk6 { color: #36F9F6; }\n  .synthwave-84 .mtk10 { color: #FEDE5D; }\n  .synthwave-84 .mtk16 { color: #FF8B39; }\n  .synthwave-84 .grvsc-line-highlighted::before {\n    background-color: var(--grvsc-line-highlighted-background-color, rgba(255, 255, 255, 0.1));\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(255, 255, 255, 0.5));\n  }\n</style>","frontmatter":{"title":"Implement JWT Based User Authentication in a MERN Stack App - Part 2","date":"2021-05-22"}}},"pageContext":{"slug":"/implement-jwt-based-user-authentication-in-a-mern-stack-app-part-2/","prev":{"fields":{"slug":"/implement-jwt-based-user-authentication-in-a-mern-stack-app-part-1/"},"frontmatter":{"modules":null}},"next":{"fields":{"slug":"/implement-jwt-based-user-authentication-in-a-mern-stack-app-part-3/"},"frontmatter":{"modules":null}}}},
    "staticQueryHashes": ["3159585216"]}