1 00:00:02,240 --> 00:00:04,640 So time to work on authentication 2 00:00:04,910 --> 00:00:10,680 and for this first of all, we can go to the app.js file and set the default auth mode to false. 3 00:00:10,700 --> 00:00:16,070 Now if everything reloads, we start on the login page and I want to start there 4 00:00:16,250 --> 00:00:22,820 so that we can switch to sign up and create users and then log in with these users. Now stitch offers us 5 00:00:22,910 --> 00:00:26,260 a simple way of adding real user authentication 6 00:00:26,470 --> 00:00:30,660 and for that, we just have to go back to users and under providers, 7 00:00:30,770 --> 00:00:39,640 we can now disable anonymous login and save that and instead turn on email password login, 8 00:00:39,860 --> 00:00:48,090 so we enable this. Now email password login ships with confirmation and password resetting built-in, 9 00:00:48,110 --> 00:00:50,560 now I'll not show the password reset part, 10 00:00:50,570 --> 00:00:52,790 you can learn all about that in the official docs, 11 00:00:52,790 --> 00:00:53,730 it's really easy 12 00:00:53,960 --> 00:00:57,890 but we need to enable e-mail confirmation so that anything works. 13 00:00:57,890 --> 00:01:02,810 So for this, users should receive an email where they are forwarded to 14 00:01:05,820 --> 00:01:10,180 localhost 3000 confirm account and you need to get that right. 15 00:01:10,260 --> 00:01:14,170 Your react app will run on this host if you deploy it onto a real server, 16 00:01:14,190 --> 00:01:16,090 you should of course update this 17 00:01:16,110 --> 00:01:21,630 and this is a page which I prepared, a route which I prepared which we then can work on to confirm the 18 00:01:21,630 --> 00:01:23,410 account with stitch. 19 00:01:23,410 --> 00:01:26,080 Now this last field here is optional, 20 00:01:26,100 --> 00:01:30,150 you could enter the subject for the confirmation email as is this field. 21 00:01:30,150 --> 00:01:34,960 This field is required and I will enter something there but this will not work. 22 00:01:35,180 --> 00:01:37,020 Right, so this is not a route I added, 23 00:01:37,080 --> 00:01:39,360 you could as a challenge do this on your own, 24 00:01:39,360 --> 00:01:43,790 I don't need resetting in my app, I want to have or I need to have confirmation though. 25 00:01:43,890 --> 00:01:45,090 So now let's save this 26 00:01:45,240 --> 00:01:50,260 and now we enabled this user email authentication. 27 00:01:50,340 --> 00:01:52,290 How do we now use that in our app?