<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Eric</title>
    <description>The latest articles on Forem by Eric (@ericadamski).</description>
    <link>https://forem.com/ericadamski</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F200236%2F62b6efb7-e7c7-4aef-b8a5-a48f7fa66998.png</url>
      <title>Forem: Eric</title>
      <link>https://forem.com/ericadamski</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/ericadamski"/>
    <language>en</language>
    <item>
      <title>I am going to build 6 products in 12 months</title>
      <dc:creator>Eric</dc:creator>
      <pubDate>Mon, 04 May 2020 20:10:41 +0000</pubDate>
      <link>https://forem.com/ericadamski/i-am-going-to-build-6-products-in-12-months-i85</link>
      <guid>https://forem.com/ericadamski/i-am-going-to-build-6-products-in-12-months-i85</guid>
      <description>&lt;p&gt;Originally posted on &lt;a href="https://attempts.space"&gt;attempts.space&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I am going to build 6 products in 12 months on my way to create financial freedom for myself. And I seem to have picked the worst time to start. Right in the middle of COVID-19. The largest economic depression since THE great depression and do I go and find a secure job?&lt;/p&gt;

&lt;p&gt;No. I do the exact opposite. I start working for myself.&lt;/p&gt;

&lt;p&gt;This all started when the office for my day job closed and we began to work from home. Without a commute I found myself with ample amount of time to do things &lt;em&gt;just for me&lt;/em&gt;. It was the most empowering and freeing 2 weeks of my life. Working on what I want, feeling like I am making an impact in the lives of people. I haven't felt that energized in ages.&lt;/p&gt;

&lt;p&gt;So I started to chase that.&lt;/p&gt;

&lt;p&gt;I started a &lt;a href="https://www.youtube.com/playlist?list=PLCct7zpeN4PFQJ1dfW1NpCfsqBZ9shT-7"&gt;vlog&lt;/a&gt;, producing &lt;a href="https://www.youtube.com/channel/UC8s7-Eb0vO7BJfudkTQUWyQ"&gt;YouTube videos&lt;/a&gt;, developing and releasing &lt;a href="https://team-img.now.sh"&gt;side projects&lt;/a&gt;, &lt;a href="https://journal.ericadamski.dev"&gt;writing&lt;/a&gt;, and reading more. I created whatever, whenever. And it was &lt;strong&gt;AMAZING&lt;/strong&gt;. So amazing that I wanted more.&lt;/p&gt;

&lt;p&gt;Then the next month passed and I hadn't been able to rekindle that experience. I couldn't find that same passion no matter the amount of searching. I figured out that the more time I spent on my day job and the less time I spent on things I wanted to do the worse I felt.&lt;/p&gt;

&lt;p&gt;So I am taking a stand.&lt;/p&gt;

&lt;p&gt;I am going to challenge myself into financial independence. Into my dream job, my destiny, into an entrepreneur.&lt;/p&gt;

&lt;p&gt;Over the next year I am going to create and launch 6 new products and work to make them profitable. The most successful business I run currently is &lt;a href="https://team-img.now.sh"&gt;Team-Img&lt;/a&gt;. It is profitable, but no where near sustainable for me to live on with only \$7 MRR.&lt;/p&gt;

&lt;p&gt;Thats right, 7 whole dollars. The math is hard but that is a total of \$84 a year. Not much to live on.&lt;/p&gt;

&lt;p&gt;But that is my inspiration. &lt;a href="https://team-img.now.sh"&gt;Team-Img&lt;/a&gt; was the catalyst that showed me I could produce something useful.&lt;/p&gt;

&lt;p&gt;And so begins my journey. Starting from \$7 MRR I will build a life for myself and my family by working on things I love with people who care. It is going to be an adventure, a challenge but most of all it will be - hard. Also fun. I am thrilled to be going on this journey and it starts today.&lt;/p&gt;

&lt;p&gt;With inspiration from &lt;a href="https://www.trypulsar.com/"&gt;Pulsar&lt;/a&gt; I am going to count &lt;a href="https://flawk.to"&gt;Flawk&lt;/a&gt;, which is super early alpha, as my first of 6 products. I have 6 others in the pipeline and over the next year I am going to attempt to make each one a profitable product.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://flawk.to"&gt;Flawk&lt;/a&gt; isn't even close. But that is where the fun is.&lt;/p&gt;

&lt;p&gt;0/6 profitable products and counting.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Flawk is in alpha!</title>
      <dc:creator>Eric</dc:creator>
      <pubDate>Tue, 14 Apr 2020 16:11:11 +0000</pubDate>
      <link>https://forem.com/ericadamski/flawk-is-in-alpha-1lf1</link>
      <guid>https://forem.com/ericadamski/flawk-is-in-alpha-1lf1</guid>
      <description>&lt;p&gt;I have been trying to build a business and gain financial independence for a couple of years now. It isn't going super well, but I am hoping that Flawk is my first step in the right direction.&lt;/p&gt;

&lt;p&gt;I started out building Flawk to help make Meetups, including the ones I run, more engaging, and inclusive by focusing on the interactions between the presenters and audience. After having a few false starts (5 months of false starts) I finally came across a meaningful way to start - remote events. Although I have big plans for Flawk and at its core it should still provide more engaging and inclusive human interactions, I chose to focus on hosting and attending remote events.&lt;/p&gt;

&lt;p&gt;You can check out our new home page &lt;a href="https://alpha.flawk.to"&gt;Flawk.to&lt;/a&gt; and get a little bit of a better idea of what we are offing. But as we enter alpha I am looking for people who are currently hosting or want to start hosting events to work with me to build an amazing experience. If you are interested you can fill out a request form here: &lt;a href="https://alpha.flawk.to/request-access"&gt;https://alpha.flawk.to/request-access&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I also want to start using Flawk myself as soon as possible! Which is what this post is really about. I want to put on a live event and give a talk about something, probably React related, but I don't know what! So here I am asking you, what do you want to see a presentation on!? Here are some subjects I enjoy talking about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Computer Science basics (data structures, algorithms, Big O)&lt;/li&gt;
&lt;li&gt;React (Hooks, building your first app, NextJS)&lt;/li&gt;
&lt;li&gt;RxJS&lt;/li&gt;
&lt;li&gt;Technical Hiring&lt;/li&gt;
&lt;li&gt;Testing and doing TDD with Jest and React Testing Library&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you have something that is not on that list that you would like to hear about, comment below I would like my first &lt;a href="https://flawk.to"&gt;Flawk&lt;/a&gt; event to be extremely fun and also useful!&lt;/p&gt;

&lt;p&gt;Thanks for listening and leave comments on what you'd like to see me talk about! I will follow up with the link to the event once it is scheduled.&lt;/p&gt;

&lt;p&gt;❤️&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>react</category>
      <category>javascript</category>
    </item>
    <item>
      <title>JWT, Cookies, Custom Hooks and getServerSideProps</title>
      <dc:creator>Eric</dc:creator>
      <pubDate>Tue, 14 Apr 2020 15:58:47 +0000</pubDate>
      <link>https://forem.com/ericadamski/jwt-cookies-custom-hooks-and-getserversideprops-12fo</link>
      <guid>https://forem.com/ericadamski/jwt-cookies-custom-hooks-and-getserversideprops-12fo</guid>
      <description>&lt;p&gt;Hey everyone!&lt;/p&gt;

&lt;p&gt;I just released some videos that show you how to add authentication to a next js application! It uses MongoDB, Cookies, JSON web tokens, SWR, React and of course NextJs.&lt;/p&gt;

&lt;p&gt;I am definitely not a pro at authentication, I am probably the furthest from it. But I would love any feed back ya'll have on these videos and the code that I am writing! I am always trying to improve. 😀&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/LfITaJNEUtI"&gt;
&lt;/iframe&gt;
&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/5Lc34F4R4i8"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>showdev</category>
    </item>
    <item>
      <title>From Idea to Launch #4 - Into to NextJS API routes</title>
      <dc:creator>Eric</dc:creator>
      <pubDate>Wed, 01 Apr 2020 20:38:34 +0000</pubDate>
      <link>https://forem.com/ericadamski/from-idea-to-launch-4-into-to-nextjs-api-routes-lhh</link>
      <guid>https://forem.com/ericadamski/from-idea-to-launch-4-into-to-nextjs-api-routes-lhh</guid>
      <description>&lt;p&gt;This week I am diving into an introduction to NextJS API routes. I also briefly talk about Formik and Yup! In this video we create and log in users using the &lt;a href="https://paassword.now.sh"&gt;PaaSsword&lt;/a&gt; service. In the next video I will cover how to maintain a user state with cookies and JWTs.&lt;/p&gt;

&lt;p&gt;Hope you enjoy! ❤️&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;iframe width="710" height="399" src="https://www.youtube.com/embed/Sdf6nIPGp30"&gt;
&lt;/iframe&gt;

&lt;/h2&gt;

&lt;p&gt;I have doing a lot of work recently on my own projects, things like: &lt;a href="https://team-img.now.sh"&gt;team-img.now.sh&lt;/a&gt; and &lt;a href="https://paassword.now.sh"&gt;PaaSsword&lt;/a&gt;. I launch both of these on Product Hunt and realized that it was super helpful to show off work you have done. Especially work that you think would be useful for other people!&lt;/p&gt;

&lt;p&gt;So I am creating a series of videos to showcase my process of taking an idea all the way to launch on Product Hunt. I re-built a tool that I really like to use for myself: &lt;a href="https://wachstum.space"&gt;Wachstum.space&lt;/a&gt;. I am going to walk you through how I made it and show case why I love to use React and NextJS to build all of my projects.&lt;/p&gt;

</description>
      <category>react</category>
      <category>showdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>From Idea to Launch Ep. 3</title>
      <dc:creator>Eric</dc:creator>
      <pubDate>Sat, 28 Mar 2020 12:26:30 +0000</pubDate>
      <link>https://forem.com/ericadamski/from-idea-to-launch-ep-3-5944</link>
      <guid>https://forem.com/ericadamski/from-idea-to-launch-ep-3-5944</guid>
      <description>&lt;p&gt;Here is the latest video in the series where I create &lt;a href="https://wachstum.space"&gt;https://wachstum.space&lt;/a&gt; using react, nextjs and now. In this episode I show you how to use React components with Nextjs and how to manage state with useReducer.&lt;/p&gt;

&lt;p&gt;Hope you enjoy! Leave some comments so I can improve 😃🙌&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/5fD_ETnXApE"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>showdev</category>
    </item>
    <item>
      <title>From Idea to Launch</title>
      <dc:creator>Eric</dc:creator>
      <pubDate>Thu, 26 Mar 2020 16:57:49 +0000</pubDate>
      <link>https://forem.com/ericadamski/from-idea-to-launch-2dl9</link>
      <guid>https://forem.com/ericadamski/from-idea-to-launch-2dl9</guid>
      <description>&lt;p&gt;I have doing a lot of work recently on my own projects, things like: &lt;a href="https://team-img.now.sh"&gt;team-img.now.sh&lt;/a&gt; and &lt;a href="https://paassword.now.sh"&gt;PaaSsword&lt;/a&gt;. I launch both of these on Product Hunt and realized that it was super helpful to show off work you have done. Especially work that you think would be useful for other people!&lt;/p&gt;

&lt;p&gt;So I am creating a series of videos to showcase my process of taking an idea all the way to launch on Product Hunt. I re-built a tool that I really like to use for myself: &lt;a href="https://wachstum.space"&gt;Wachstum.space&lt;/a&gt;. I am going to walk you through how I made it and show case why I love to use React and NextJS to build all of my projects.&lt;/p&gt;

&lt;p&gt;Hope you enjoy!&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/Y2-O20RclNI"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>react</category>
      <category>showdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>5 Tips to Master the Interview</title>
      <dc:creator>Eric</dc:creator>
      <pubDate>Thu, 26 Mar 2020 12:04:05 +0000</pubDate>
      <link>https://forem.com/ericadamski/5-tips-to-master-the-interview-2fjp</link>
      <guid>https://forem.com/ericadamski/5-tips-to-master-the-interview-2fjp</guid>
      <description>&lt;p&gt;Interviewing is hard.&lt;/p&gt;

&lt;p&gt;I tell that to everyone. The people I am interviewing, the people I have interviewed and the people I train how to do interviews. Still we loose sight of this as soon as we sit in that chair and the questions about our abilities start to fly. You are being asked to judge yourself, in the moment, with questions you'd never expect. Questions you would have a hard time answering on a normal day.&lt;/p&gt;

&lt;p&gt;It is hard not to feel personally about interviews, because they are personal. At least for me they are. That is actually where your power comes from. Who is the absolute best person to be talking about you? You.&lt;/p&gt;

&lt;p&gt;Currently in my role as Director of Software Development I am working to revamp the hiring process. Through this I have created and given training on how to best conduct interviews. I have also given over 100 interviews myself in the last 3 months. Here are 5 things I wish I was seeing from candidates and the reasons they will help you land the job.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;1. Be yourself&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This one might seem obvious, but it is the number 1 thing that I find is lacking. People, including myself, try to put on a show. To paint ourselves in the best light, even exaggerate our ability to make ourselves look more appealing. What ever the reason I am not hiring the person you want to be, I am hiring you. Show me your personality, be quirky, be different. A group of similar people will never build anything as good as a diverse group of people. Any organization thrives on diversity.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;2. Share the bad things&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This seems counter intuitive to do in interviews. But sharing the bad things is almost as important, if not more, than sharing the good things. It is a fact that everyone makes mistakes, everyone has things to work on. Sharing yours shows that you understand where your short comings are. Being aware of short comings means you are working to improve them. Sharing working failures allows you to explain and diagnose a past situation. You can show that you learned from that mistake and talk about how you can prevent it in the future. Showing interest in your own improvement will signal to your interviewers you are ready to learn, and work, to be better.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;3. Have a plan&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Now, you might be asking: "How can I possibly have a plan for something I have never done?". Good question! It isn't about planning your answers to the interview questions, or planning your introductions (although visualization for those areas is great practice!). Having a plan is about understanding where you want to be going in your career and preparing the items you want to share about yourself. This helps you guide the conversation, focusing on where you can show off. It also shows that you have interest in growing into a position. It is a good tell for me if my interviewers only care about filling a role. If they don't ask about your future, your ambitions or goals then it may not be a place where you can grow. Jobs are always a give and take. You contribute your skills. In return you get the mentorship and direction your require to move closer to where you want to be in life.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;4. Understand your value&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;One of the hardest questions I ever got asked, and now I use in my interviews, is &lt;em&gt;"What value do you bring to our team/company?".&lt;/em&gt; Whether you get asked this question or not, you should take some time and understand what you bring to the table. You are unique, and you bring a unique perspective and skills to any team. Being able to articulate what that is will put you above 90% of your competitors for any job. Understand what makes you different and showcase that! People deserve to know what makes you great!&lt;/p&gt;

&lt;p&gt;You can always ask yourself the questions &lt;em&gt;"What value do I bring?"&lt;/em&gt; in the context of your dream job! This will help you figure out what makes you different. If you can picture contributing in a team of people you want to learn from.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;5. Invest&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Very often we fear the feeling of rejection. It may lead us to remove ourselves from interviews mentally even before they begin. I am not looking for you to commit, but when I interview someone who has already put themselves in the position it brings a different energy. Showing that you are looking to the future. What kind of difference you can make in the organization by investing in the company and the process, the better I can picture you being a part of the team. Similarly make sure the company is investing in you from the start. Always seek feedback from your interviewers. It will show you if they are willing to help you grow, even if you are not part of the company.&lt;/p&gt;

&lt;p&gt;Again, interviews are hard. They are mentally and emotionally draining to prepare for, conduct and to get results - especially if it is a no. More than likely that won't change. The more energy you put into the process, the more you will get out. But the greater the feeling of failure and self-doubt if you don't succeed. Know that if you do not get the position it wasn't meant to be right now, but that doesn't mean it won't work out in the future. Be yourself, plan, understand your value and invest in your growth, you will get there!&lt;/p&gt;

&lt;p&gt;Outside of interviews you should be focusing on the work you love. As an interviewer I look for passion, but it most definitely does not have to be about programming. Bringing energy to a job can come from many different places, including places that are not related to your job.&lt;/p&gt;

&lt;p&gt;I will leave you with this, NEVER FORGET interviews are two ways. You are doing the interviewing as much as you are being interviewed. You have to figure out if the company is going to help you get where you want to go, if they are going to be the right fit for you. It is hard, but don't ever be afraid to say no.&lt;/p&gt;

&lt;p&gt;Remember, interviewing will never be a good representation of the work you can do, be honest. To yourself, and to others. Build trust and relationships.&lt;/p&gt;

&lt;p&gt;Thanks for reading! Stay safe during this COVID-19 pandemic.&lt;/p&gt;

&lt;p&gt;Here is a video of my vlog which is me talking about some of the same topics:&lt;/p&gt;

&lt;p&gt;YouTube: &lt;iframe width="710" height="399" src="https://www.youtube.com/embed/4bAMlMMt-Io"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>career</category>
      <category>beginners</category>
      <category>advice</category>
    </item>
    <item>
      <title>From idea to launch with react</title>
      <dc:creator>Eric</dc:creator>
      <pubDate>Tue, 24 Mar 2020 23:05:41 +0000</pubDate>
      <link>https://forem.com/ericadamski/from-idea-to-launch-with-react-1lb4</link>
      <guid>https://forem.com/ericadamski/from-idea-to-launch-with-react-1lb4</guid>
      <description>&lt;p&gt;I'm publishing a series on taking an idea to launch with react, nextjs and now! Take a look at the first video and let me know what you think! I'd love to be able to improve for the next video I shoot 🙌&lt;/p&gt;

&lt;p&gt;I also recent added a few changes to &lt;a href="https://teaming.now.sh"&gt;https://teaming.now.sh&lt;/a&gt; that is love for you to check out and give feedback 😃&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/03VW35Le1lE"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Thanks for reading, stay safe out there! ♥️&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>react</category>
    </item>
    <item>
      <title>Simple Password Management with React and NextJS</title>
      <dc:creator>Eric</dc:creator>
      <pubDate>Mon, 17 Feb 2020 18:17:33 +0000</pubDate>
      <link>https://forem.com/ericadamski/simple-password-management-with-react-and-nextjs-2je1</link>
      <guid>https://forem.com/ericadamski/simple-password-management-with-react-and-nextjs-2je1</guid>
      <description>&lt;p&gt;Originally posted on &lt;a href="https://attempts.space"&gt;Attempts.space&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Here I will show you how you can add simple password management to your React application in minutes using &lt;a href="https://paassword.now.sh"&gt;paassword.now.sh&lt;/a&gt;. In this article I will be using React and the &lt;a href="https://nextjs.org"&gt;NextJS&lt;/a&gt; framework! I recorded a live stream doing this exact same thing for a personal project of my own, you can see it &lt;a href="https://www.youtube.com/watch?v=b_DcxjKUKOw"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/b_DcxjKUKOw"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;First we are going to create our sign up / log in page by creating a file in the &lt;code&gt;pages&lt;/code&gt; directory of our project, something like: &lt;code&gt;pages/sign-up.js&lt;/code&gt;. Using NextJS this will now allow you to navigate to the route &lt;code&gt;/sign-up&lt;/code&gt; in your browser. In that file we can add our form:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// pages/sign-up.js&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;handleSubmit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;preventDefault&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Log&lt;/span&gt; &lt;span class="nx"&gt;In&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;form&lt;/span&gt; &lt;span class="nx"&gt;onSubmit&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleSubmit&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt;
                    &lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;email&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
                    &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;email&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
                    &lt;span class="nx"&gt;placeholder&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Enter email&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
                &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
                &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt;
                    &lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;password&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
                    &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;password&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
                    &lt;span class="nx"&gt;placeholder&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Enter password&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
                &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
                &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt; &lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;submit&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Let&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;s go!&amp;lt;/button&amp;gt;
            &amp;lt;/form&amp;gt;
        &amp;lt;/&amp;gt;
    )
}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Now we want to handle the submission of that form to create a new user or login a current user. For that we will need an api route, which I will call &lt;code&gt;/api/user/auth&lt;/code&gt;. Here is the structure for that file:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// pages/api/user/auth.js&lt;/span&gt;
&lt;span class="c1"&gt;// A service to connect to Mongo DB&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;connectToDb&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./services/connect-to-db&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// A Mongoose model for a user that contains an email and a password Id&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;User&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./models/User&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Make sure we initiate our database connection&lt;/span&gt;
    &lt;span class="nx"&gt;connectToDb&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="c1"&gt;// our plain text email and password from the form&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;password&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;// Send a 200 OK&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;end&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;To store our email and password we will need to create a &lt;code&gt;fetch&lt;/code&gt; request to our api route.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// pages/sign-up.js&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;fetch&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;fetch&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;handleSubmit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;preventDefault&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;emailElement&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;password&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;passwordElement&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;elements&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;email&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;emailElement&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;password&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;passwordElement&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/api/user/auth&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;application/json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;password&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
        &lt;span class="p"&gt;})&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ok&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="c1"&gt;// successfully created a new user&lt;/span&gt;
            &lt;span class="c1"&gt;// OR logged in!&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Log&lt;/span&gt; &lt;span class="nx"&gt;In&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;form&lt;/span&gt; &lt;span class="nx"&gt;onSubmit&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleSubmit&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt;
                    &lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;email&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
                    &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;email&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
                    &lt;span class="nx"&gt;placeholder&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Enter email&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
                &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
                &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt;
                    &lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;password&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
                    &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;password&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
                    &lt;span class="nx"&gt;placeholder&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Enter password&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
                &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
                &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt; &lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;submit&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Let&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;s go!&amp;lt;/button&amp;gt;
            &amp;lt;/form&amp;gt;
        &amp;lt;/&amp;gt;
    )
}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;In that handler we will want to create a new user! First we need to store and encrypt our password in &lt;a href="https://paassword.now.sh"&gt;paassword.now.sh&lt;/a&gt;. Then we can store the &lt;code&gt;id&lt;/code&gt; that paassword returns in our own database to use later to verify password attempts.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// pages/api/user/auth.js&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;fetch&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;isomorphic-unfetch&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;connectToDb&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./services/connect-to-db&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;User&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./models/User&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;connectToDb&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;password&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;// Store the password in paassword.now.sh&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;paasswordResponse&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://paassword.now.sh/api/create&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;application-json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;pwd&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;password&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;paasswordRresponse&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ok&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// get the id from the response&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;paasswordResponse&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

        &lt;span class="c1"&gt;// store the id and the email so we can log in later&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;User&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
            &lt;span class="nx"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;passwordId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;

        &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;save&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;end&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;a href="https://paassword.now.sh"&gt;Paassword&lt;/a&gt; uses &lt;a href="https://airtable.com/"&gt;Airtable&lt;/a&gt; to store encrypted strings that are only reference-able by the &lt;code&gt;id&lt;/code&gt; that is returned. You can learn more about how it works &lt;a href="https://attempts.space/paassword/"&gt;here&lt;/a&gt; and see the open source code &lt;a href="https://github.com/ericadamski/serverless-password"&gt;here&lt;/a&gt;. Storing a secure password is as simple as one request like this:&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vJ70wriM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/github-logo-ba8488d21cd8ee1fee097b8410db9deaa41d0ca30b004c0c63de0a479114156f.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/ericadamski"&gt;
        ericadamski
      &lt;/a&gt; / &lt;a href="https://github.com/ericadamski/serverless-password"&gt;
        serverless-password
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A simple, secure way to create a password checker without needing a server
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
serverless-password&lt;/h1&gt;
&lt;p&gt;A simple set of routes for securly storing and testing ad-hoc passwords:&lt;/p&gt;
&lt;h2&gt;
How to use&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Go enter the password you want to use here: &lt;a href="https://paassword.now.sh" rel="nofollow"&gt;https://paassword.now.sh&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Copy the URL given to you from step 1&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Make a &lt;code&gt;POST&lt;/code&gt; request to the URL you receive&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight highlight-source-js"&gt;&lt;pre&gt;&lt;span class="pl-k"&gt;import&lt;/span&gt; &lt;span class="pl-s1"&gt;fetch&lt;/span&gt; &lt;span class="pl-k"&gt;from&lt;/span&gt; &lt;span class="pl-s"&gt;"unfetch"&lt;/span&gt;
&lt;span class="pl-k"&gt;const&lt;/span&gt; &lt;span class="pl-s1"&gt;response&lt;/span&gt; &lt;span class="pl-c1"&gt;=&lt;/span&gt; &lt;span class="pl-k"&gt;await&lt;/span&gt; &lt;span class="pl-en"&gt;fetch&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-s"&gt;"&amp;lt;YOUR_URL&amp;gt;"&lt;/span&gt;&lt;span class="pl-kos"&gt;,&lt;/span&gt; &lt;span class="pl-kos"&gt;{&lt;/span&gt;
    &lt;span class="pl-c1"&gt;method&lt;/span&gt;: &lt;span class="pl-s"&gt;"POST"&lt;/span&gt;&lt;span class="pl-kos"&gt;,&lt;/span&gt;
    &lt;span class="pl-c1"&gt;headers&lt;/span&gt;: &lt;span class="pl-kos"&gt;{&lt;/span&gt; &lt;span class="pl-s"&gt;"Content-Type"&lt;/span&gt;: &lt;span class="pl-s"&gt;"application/json"&lt;/span&gt; &lt;span class="pl-kos"&gt;}&lt;/span&gt;&lt;span class="pl-kos"&gt;,&lt;/span&gt;
    &lt;span class="pl-c1"&gt;body&lt;/span&gt;: &lt;span class="pl-c1"&gt;JSON&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-en"&gt;stringify&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-kos"&gt;{&lt;/span&gt; &lt;span class="pl-c1"&gt;pwd&lt;/span&gt;: &lt;span class="pl-s"&gt;'your password attempt'&lt;/span&gt; &lt;span class="pl-kos"&gt;}&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;
&lt;span class="pl-kos"&gt;}&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;
&lt;span class="pl-k"&gt;if&lt;/span&gt; &lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-s1"&gt;response&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-c1"&gt;ok&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt; &lt;span class="pl-kos"&gt;{&lt;/span&gt;
    &lt;span class="pl-k"&gt;const&lt;/span&gt; &lt;span class="pl-kos"&gt;{&lt;/span&gt; valid &lt;span class="pl-kos"&gt;}&lt;/span&gt; &lt;span class="pl-c1"&gt;=&lt;/span&gt; &lt;span class="pl-k"&gt;await&lt;/span&gt; &lt;span class="pl-s1"&gt;response&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-en"&gt;json&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;
    &lt;span class="pl-smi"&gt;console&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-en"&gt;log&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-s1"&gt;valid&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt; &lt;span class="pl-c"&gt;// true || false&lt;/span&gt;
&lt;span class="pl-kos"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;
Live example&lt;/h2&gt;
&lt;p&gt;You can run this in a modern browser console.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;be careful of CORS 😡&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="highlight highlight-source-js"&gt;
&lt;pre&gt;&lt;span class="pl-k"&gt;async&lt;/span&gt; &lt;span class="pl-k"&gt;function&lt;/span&gt; &lt;span class="pl-en"&gt;validatePassword&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-s1"&gt;pwd&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt; &lt;span class="pl-kos"&gt;{&lt;/span&gt;
    &lt;span class="pl-k"&gt;const&lt;/span&gt; &lt;span class="pl-s1"&gt;response&lt;/span&gt; &lt;span class="pl-c1"&gt;=&lt;/span&gt; &lt;span class="pl-k"&gt;await&lt;/span&gt; &lt;span class="pl-en"&gt;fetch&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-s"&gt;"https://svrlss.now.sh/api/get/rec3T73O3WNZk3IZj"&lt;/span&gt;&lt;span class="pl-kos"&gt;,&lt;/span&gt; &lt;span class="pl-kos"&gt;{&lt;/span&gt;
        &lt;span class="pl-c1"&gt;method&lt;/span&gt;: &lt;span class="pl-s"&gt;"POST"&lt;/span&gt;&lt;span class="pl-kos"&gt;,&lt;/span&gt;&lt;/pre&gt;…&lt;/div&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/ericadamski/serverless-password"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://paassword.now.sh/api/create&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;application-json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;pwd&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;password&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;That request returns us an &lt;code&gt;id&lt;/code&gt; we can then validate a password against. Once it is stored in our database, using MongoDB in the example above, we can then reference by email and compare passwords with our &lt;code&gt;passwordId&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Now if we want to check if someone has logged in, we can:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;find their user record by looking up their email&lt;/li&gt;
&lt;li&gt;use their &lt;code&gt;passwordId&lt;/code&gt; to request a comparison from paassword
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// pages/api/user/auth.js&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;fetch&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;isomorphic-unfetch&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;connectToDb&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./services/connect-to-db&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;User&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./models/User&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;connectToDb&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;password&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;// Attempt to find a user with that email&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;User&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;findOne&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;email&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// We have found a user that matches the input email,&lt;/span&gt;
        &lt;span class="c1"&gt;// now we have to validate that the password entered&lt;/span&gt;
        &lt;span class="c1"&gt;// matches what we originally saved&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;validateResponse&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="s2"&gt;`https://paassword.now.sh/api/get/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;passwordId&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;application/json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
                &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;pwd&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;password&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;validateResponse&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ok&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;valid&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;validateResponse&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;valid&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="c1"&gt;// The passwords match! send a 200 OK&lt;/span&gt;
                &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;end&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="c1"&gt;// The passwords don't match or there has been&lt;/span&gt;
        &lt;span class="c1"&gt;// a network failure trying to reach paasswords&lt;/span&gt;
        &lt;span class="c1"&gt;// send unauthorized.&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;401&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;end&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;paasswordResponse&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://paassword.now.sh/api/create&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;application-json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;pwd&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;password&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;paasswordRresponse&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ok&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;paasswordResponse&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

        &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;User&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
            &lt;span class="nx"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;passwordId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;

        &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;save&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;end&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;There it is!&lt;/p&gt;

&lt;p&gt;A relatively simple way to integrate password authentication in your React app. This does not cover handling front end tokens like &lt;a href="https://jwt.io/"&gt;JWTs&lt;/a&gt; or cookies but they can easily be added on now that verifying passwords is complete. Let me know if you want a more concrete example of this working or want to me write a follow up about JWT and cookies.&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

</description>
      <category>react</category>
      <category>showdev</category>
      <category>javascript</category>
      <category>node</category>
    </item>
    <item>
      <title>Why I created 2 new software tools in 4 hours</title>
      <dc:creator>Eric</dc:creator>
      <pubDate>Sat, 08 Feb 2020 06:11:48 +0000</pubDate>
      <link>https://forem.com/ericadamski/why-i-created-2-new-tools-in-4-hours-1op2</link>
      <guid>https://forem.com/ericadamski/why-i-created-2-new-tools-in-4-hours-1op2</guid>
      <description>&lt;p&gt;My new role at work doesn't involve coding. I went from coding 8+ hours a day, mashing at keys, to answering emails and writing documents - a different type of key mashing. But today I got the chance to write some code, and it was &lt;strong&gt;SUBLIME&lt;/strong&gt;!&lt;/p&gt;

&lt;p&gt;I am working on changing how hiring is done at my company, shifting the perspective away from skills and onto culture and values. (If you are interested in my stance you can get a brief idea from &lt;a href="https://technical-hiring.now.sh/"&gt;these slides&lt;/a&gt;) Since I am still a programmer at heart I feel way more creative using &lt;a href="https://github.com/jxnblk/mdx-deck"&gt;mdx-deck&lt;/a&gt; to create my slide decks. It is a hybrid &lt;a href="https://reactjs.org/"&gt;React&lt;/a&gt; and &lt;a href="https://en.wikipedia.org/wiki/Markdown"&gt;Markdown&lt;/a&gt; based presentation tool that allows me to manipulate, in finer detail, every aspect of the presentation. Does it take longer? &lt;strong&gt;YES&lt;/strong&gt;. But it is significantly more enjoyable for me and it keeps me engaged. So here I am writing this slide deck for values based hiring training. I want each attendee to have easy access to the slides. I figured the internet was the easiest way to share them - since I'm programming anyway. &lt;strong&gt;BUT&lt;/strong&gt; there is a huge problem. The presentation is for internal company use only - ⚠️&lt;strong&gt;CONFIDENTIAL&lt;/strong&gt;⚠️! I was stuck. How can I put up my slides and keep them confidential? My answer: &lt;strong&gt;Passwords&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I thought I should password protect this presentation and that way everyone can have easy access to the presentation from the internet, at the same time being protected against wandering eyes. I spent 4 hours of my day solving this problem - &lt;em&gt;how can I password protect a mdx slide deck&lt;/em&gt;? Since it uses React I figured the interface work would be simple, and truthfully there wasn't much to it. An input field, a label and a button to unlock the slides. The hard pard was figuring out how am was going to make sure the password was safe. I could hard code it into the presentation, but that doesn't seem secure enough. Which then means I have to keep it in some sort of environment variable. But I only have a front end I cannot use hidden secrets in environment files. I don't really want to have to write a complete backend for my slide deck! So I was stuck; &lt;em&gt;how do I store a password, &lt;strong&gt;SECURELY&lt;/strong&gt;, and validate against it without keeping it in the source code&lt;/em&gt;? 💥&lt;strong&gt;BOOM&lt;/strong&gt;💥 then comes an idea!&lt;/p&gt;

&lt;p&gt;I decide that encrypting and storing passwords doesn't need a lot of technology. It needs:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Some way of setting a password&lt;/li&gt;
&lt;li&gt;Some place to store the encrypted version of the password&lt;/li&gt;
&lt;li&gt;Some way of comparing an attempt to the encrypted version of the password&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;With all the tools that exist today I had to do very little work or setup to cross those 3 requirements off of my list. I decided I would write 2 &lt;a href="https://en.wikipedia.org/wiki/Serverless_computing"&gt;serverless&lt;/a&gt; functions, one to handle creating, encrypting and storing a new password and one to compare passwords. I used the amazing products provided by &lt;a href="https://now.sh"&gt;ZEIT&lt;/a&gt; to write and host my functions. And the &lt;em&gt;"database"&lt;/em&gt; for the encrypted passwords? I used &lt;a href="https://airtable.com/"&gt;Airtable&lt;/a&gt;. With these two technologies I was able to go from idea, to a completely working service in less than an hour!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You can check out the code &lt;a href="https://github.com/ericadamski/serverless-password/tree/master/api"&gt;here&lt;/a&gt;, it's open source!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In case you are worried about sending your passwords to some random persons Airtable, I don't blame you. Honestly, this is all I am storing!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9vnMO7MR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://user-images.githubusercontent.com/6516758/74079764-dbbd5180-4a09-11ea-92f6-d59b4de46064.png" class="article-body-image-wrapper"&gt;&lt;img width="424" alt="encrypted passwords" src="https://res.cloudinary.com/practicaldev/image/fetch/s--9vnMO7MR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://user-images.githubusercontent.com/6516758/74079764-dbbd5180-4a09-11ea-92f6-d59b4de46064.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There is no information in that table other than the encrypted password.&lt;/p&gt;

&lt;p&gt;After this fun little foray of creating what I am calling a &lt;code&gt;Password as a Service&lt;/code&gt; 😂 tool, I got right to creating my password protected presentation! The code for this is also open source and you can check it out &lt;a href="https://github.com/ericadamski/protect-a-deck/blob/master/index.js"&gt;here&lt;/a&gt;. I found it worked so well that I had to create a package for other people to use, so now you can also password protect your mdx-deck presentations with &lt;code&gt;protect-a-deck&lt;/code&gt; 😂 (I am on fire with names right now 🔥).&lt;/p&gt;

&lt;p&gt;Let me explain how this all works!&lt;/p&gt;

&lt;p&gt;First, you come to my wonderful, publicly accessible website where the presentation is. The code checks to see if you have validated yourself, if you have not it doesn't show you any of the slide content.&lt;/p&gt;

&lt;p&gt;In React something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;valid&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;children&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="cm"&gt;/* lock screen */&lt;/span&gt; &lt;span class="p"&gt;)}&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The content of the slides isn't rendered and so it cannot be inspected with developer tools. &lt;strong&gt;You just can't see it!&lt;/strong&gt;. Once you enter in your password I send off a request, to the handy new service I created, which checks against the password I set to see if they match. If they do, &lt;strong&gt;YOU'RE IN&lt;/strong&gt;. Otherwise I send a very straight forward message kindly letting you know that you didn't make it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tBVi7IPZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://user-images.githubusercontent.com/6516758/74079890-618dcc80-4a0b-11ea-87bb-a7302fa9ee6b.png" class="article-body-image-wrapper"&gt;&lt;img width="362" alt="example failed password validation" src="https://res.cloudinary.com/practicaldev/image/fetch/s--tBVi7IPZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://user-images.githubusercontent.com/6516758/74079890-618dcc80-4a0b-11ea-87bb-a7302fa9ee6b.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It was so smooth I thought that I have to share this with other people! Not just the code, but also just a nice way people could create and easily validate their own secure passwords. So I popped a UI onto my two serverless functions to help create and compare passwords. I called it, because I am so good at naming 😂, &lt;a href="https://paassword.now.sh"&gt;PaaS-sword&lt;/a&gt;. You can head over there and start comparing passwords!&lt;/p&gt;

&lt;p&gt;Before I let you go, let me give you an extremely quick rundown of how &lt;a href="https://paassword.now.sh"&gt;PaaS-sword&lt;/a&gt; works.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You submit a plain text password (don't worry I use &lt;code&gt;https&lt;/code&gt;, so it is somewhat safe in transit).&lt;/li&gt;
&lt;li&gt;My first serverless function uses &lt;a href="https://www.npmjs.com/package/bcrypt"&gt;bcrypt&lt;/a&gt; to encrypt the plain text password.&lt;/li&gt;
&lt;li&gt;I store the encrypted password in the Airtable, &lt;strong&gt;BOOM&lt;/strong&gt; stored.&lt;/li&gt;
&lt;li&gt;I then return the Airtable reference to the row that the encrypted password exists in so we can compare against it later.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now when I want to compare them,&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;I send a &lt;code&gt;POST&lt;/code&gt; request with the Airtable reference from above (on the site I give you a nice URL for it) and some new plain text password to compare against.&lt;/li&gt;
&lt;li&gt;I get the encrypted password from the Airtable and compare that with the plain text password you just sent.&lt;/li&gt;
&lt;li&gt;If bcrypt says they match, &lt;strong&gt;HOORAY&lt;/strong&gt;, if not, too bad.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;My severs store nothing, the only thing that persists in Airtable is a fun string like:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;$2b$10\$2o2z7RbWDeuEw.3sH4jYBuRbsQXVV9keK.83jcw01uQGjMiTY3cUW&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Which means nothing to nobody and can never be translated back into plain text.&lt;/p&gt;

&lt;p&gt;All of this to say I had a blast being creative about solving my problems. It is amazing the tools that exist to solve even seemingly trivial problems. These tools are only hours old, they have a long way to go before they fulfill their full potential. If you use them, and you like them, let me know so I can continue to make them better!&lt;/p&gt;

&lt;p&gt;This was written at 1AM, so please - be kind to the tired rambling version of myself 😂&lt;/p&gt;

&lt;p&gt;Thank you for reading!&lt;/p&gt;

</description>
      <category>react</category>
      <category>showdev</category>
      <category>javascript</category>
      <category>serverless</category>
    </item>
    <item>
      <title>My new blog</title>
      <dc:creator>Eric</dc:creator>
      <pubDate>Mon, 30 Dec 2019 01:00:44 +0000</pubDate>
      <link>https://forem.com/ericadamski/my-new-blog-17le</link>
      <guid>https://forem.com/ericadamski/my-new-blog-17le</guid>
      <description>&lt;p&gt;I have decided to write less on dev.to. Which seems like a ridiculous statement given how good of a platform it is. Here is my reasoning.&lt;/p&gt;

&lt;p&gt;I have a new day job that does not involve coding, like at all. Most of what I do outside of work is build my company &lt;a href="https://flawk.to"&gt;flawk.to&lt;/a&gt;, which involves some coding but nothing of immense value yet. But I still want to write. So I created a new blog called &lt;a href="https://attempts.space/"&gt;Attempts.&lt;/a&gt;. There I will be posting about my life as a father, my business development and current day job goings on - which will be very interesting in the coming months.&lt;/p&gt;

&lt;p&gt;I wrote my first post &lt;a href="https://attempts.space/the-beginning/"&gt;https://attempts.space/the-beginning/&lt;/a&gt;, I would love it if y'all could take a look and give me some feedback! The blog is open source and based heavily on &lt;a href="https://twitter.com/dan_abramov"&gt;Dan Abramov's&lt;/a&gt; &lt;a href="https://overreacted.io"&gt;overreacted.io&lt;/a&gt;. It is hosted on &lt;a href="https://now.sh"&gt;Zeit's now&lt;/a&gt; feel free to ask me anything about building it.&lt;/p&gt;

&lt;p&gt;Also, do you think it is a good idea to post less on dev.to even if my content is less development related?&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Update on Flawk.to</title>
      <dc:creator>Eric</dc:creator>
      <pubDate>Wed, 18 Dec 2019 20:03:46 +0000</pubDate>
      <link>https://forem.com/ericadamski/update-on-flawk-to-2k74</link>
      <guid>https://forem.com/ericadamski/update-on-flawk-to-2k74</guid>
      <description>&lt;p&gt;It has been a crazy past 3 weeks. As we are moving into the holiday season I have decided to take some time off. Which means that for the next few weeks there will be no live stream 😭. There is one thing that I have been enjoying, and wanting to get better at, that I will continue - writing.&lt;/p&gt;

&lt;p&gt;It has been a goal of mine to get better at writing. To get better at written communication. I have been reading a lot more, and I notice my comfort level with words starting to increase. I don't want to lose that. My posts about &lt;a href="https://flawk.to"&gt;Flawk.to&lt;/a&gt; have not been great examples of excellent writing. I am more excited about the code and producing the product that I neglect the communication. I want to change this over my break.&lt;/p&gt;

&lt;p&gt;I will still be coding. Now that I do a lot less of it at work (actually none of it) it has become a much more enjoyable past time for me. But I want to continue the habit I have developed of writing the &lt;a href="https://flawk.to"&gt;Flawk.to&lt;/a&gt; update every week. I do want to make them better. I want to focus on the content and communication rather than the product. So here is my first, more communicative post.&lt;/p&gt;

&lt;p&gt;I have been working as a full stack developer/team lead for the past 3 years. The company that I worked for recently got acquired, and two weeks ago I got a new position in the parent company. I am now the director of software development for a 300 person company. I am excited about this new role, and I only see massive opportunity. I want to start talking a more about that. I will be creating development standards, helping with new acquisitions, developing hiring practices and building new development teams. This company and the experience is nothing like I have never experienced. So I want to talk more about it. Talk more about the problems we encounter. Our solutions. My experience shifting a company culture by building empowered teams.&lt;/p&gt;

&lt;p&gt;Besides that I will continue to build &lt;a href="https://flawk.to"&gt;Flawk.to&lt;/a&gt;. I have recently finished reading &lt;a href="https://www.amazon.ca/Start-Why-Leaders-Inspire-Everyone/dp/1591846447/ref=sr_1_1?gclid=Cj0KCQiAuefvBRDXARIsAFEOQ9EvsY-jLKv9WkYY_l5YTfZ3IiXFCaewPykDoe--CNNj7F7yPEKRDL0aAovuEALw_wcB&amp;amp;hvadid=267126174630&amp;amp;hvdev=c&amp;amp;hvlocphy=9000684&amp;amp;hvnetw=g&amp;amp;hvqmt=e&amp;amp;hvrand=11213666538576827066&amp;amp;hvtargid=aud-748919244867%3Akwd-300077434280&amp;amp;hydadcr=3290_10310796&amp;amp;keywords=start+with+a+why&amp;amp;qid=1576698372&amp;amp;sr=8-1"&gt;"Start with Why"&lt;/a&gt;, a brilliant book about leadership. As I continue to develop &lt;a href="https://flawk.to"&gt;Flawk.to&lt;/a&gt; I want to make sure I follow some of the principles from that book. I will be working on developing &lt;a href="https://flawk.to"&gt;Flawk.to&lt;/a&gt;'s purpose - it's Why. I am positive I am close to it. What's important about the Why, is alignment of every part of the application and business with the Why. That is what my focus will be for the next couple of weeks.&lt;/p&gt;

&lt;p&gt;I will continue to write. More than likely every Wednesday, but I am going to encourage myself to write more spontaneously. I will be writing about &lt;a href="https://flawk.to"&gt;Flawk.to&lt;/a&gt; and my mission to find and align with Why. As well as my journey through my new role as director of software development. I am sure there will be some random nonsense in there as well.&lt;/p&gt;

&lt;p&gt;If anything I talk about interests you, you can &lt;a href="https://twitter.com/zealigan"&gt;follow me on Twitter&lt;/a&gt; for smaller, real-time bits. Make sure to take a break, relax, and make space for creativity.&lt;/p&gt;

&lt;p&gt;Thanks for reading ❤️&lt;/p&gt;




&lt;p&gt;I am on a kick 🦵 right now. In my new role I have been meeting and talking with a lot of new people. AND I LOVE IT! So if you want to chat about anything, I am here to listen 👂.&lt;/p&gt;

&lt;p&gt;All feedback about my writing is welcome! I am working at getting better. There is nothing more helpful than your opinion.&lt;/p&gt;

</description>
      <category>career</category>
      <category>watercooler</category>
    </item>
  </channel>
</rss>
