1
00:00:00,240 --> 00:00:00,720
Wonderful.

2
00:00:00,750 --> 00:00:08,880
Once we have everything in place when it comes to register, when it comes to logging, as well as verification

3
00:00:08,880 --> 00:00:15,150
token before we set anything up, before we start sending emails and all that.

4
00:00:15,510 --> 00:00:23,040
Let me just say that we'll first do everything we as a postman because I don't want to involve the front

5
00:00:23,040 --> 00:00:23,520
end yet.

6
00:00:24,090 --> 00:00:33,090
And before we even do that, I want you to understand the main idea where since we're asking to verify

7
00:00:33,090 --> 00:00:40,350
the email behind the scenes, we're somehow sending that token back to a user.

8
00:00:40,680 --> 00:00:41,040
Correct.

9
00:00:41,250 --> 00:00:43,560
So eventually, we'll do that using the email.

10
00:00:43,560 --> 00:00:46,260
But for now, we'll just do that using the postman.

11
00:00:46,440 --> 00:00:47,430
That's why we're here.

12
00:00:47,640 --> 00:00:48,600
We have this token.

13
00:00:49,080 --> 00:00:55,350
So in between the logging, the successful logging and register, there's this middle step.

14
00:00:55,680 --> 00:01:02,460
Effectively, there's that middle route and the way it looks like we go over here or send an email.

15
00:01:02,760 --> 00:01:07,890
And as a quick side note, looks like somebody's just using my ethereal values or chicken.

16
00:01:08,280 --> 00:01:09,180
It's not a big deal.

17
00:01:09,390 --> 00:01:10,560
It's a fake account anyway.

18
00:01:10,560 --> 00:01:15,450
So and here I can see the David at gmail.com.

19
00:01:15,690 --> 00:01:17,610
So that's my email confirmation.

20
00:01:17,760 --> 00:01:20,730
I click and then I have a link, correct?

21
00:01:21,270 --> 00:01:26,460
Now what I want to showcase, though, is the fact that once we go here.

22
00:01:27,680 --> 00:01:29,300
We go to our front end.

23
00:01:30,090 --> 00:01:32,570
And notice the URL.

24
00:01:33,660 --> 00:01:38,280
So this is going to be the front end URL, and there are two things passed in here.

25
00:01:39,200 --> 00:01:46,610
The token, which is going to be that verification token, as well as the email and behind the scenes,

26
00:01:46,880 --> 00:01:50,240
what's happening on the front end, we read these values.

27
00:01:50,600 --> 00:01:56,750
So again, code will be already prepared for you and front that makes a request.

28
00:01:57,380 --> 00:02:02,990
Now, unfortunately, I think it's going to be very hard for me to showcase that I can only showcase

29
00:02:02,990 --> 00:02:04,580
the error once.

30
00:02:04,610 --> 00:02:11,240
Let me refresh and noticed in this case, there's an error because we already verified the account.

31
00:02:11,510 --> 00:02:12,950
That's why we're getting 401.

32
00:02:13,310 --> 00:02:15,650
So again, if this is a little bit confusing, don't worry about it.

33
00:02:16,070 --> 00:02:17,750
The most important one is this one.

34
00:02:18,110 --> 00:02:26,750
So in between the register where we just registered user and user still not verified and logged in,

35
00:02:26,750 --> 00:02:29,740
where a user should be already verified in order to log in.

36
00:02:30,210 --> 00:02:31,400
There's this middle step.

37
00:02:31,820 --> 00:02:33,740
There's this verify email.

38
00:02:33,980 --> 00:02:36,290
So effectively we need to set up this route.

39
00:02:36,710 --> 00:02:38,740
And then we're going to be looking for two things.

40
00:02:39,200 --> 00:02:43,310
We're going to be looking for verification token as well as the email.

41
00:02:43,580 --> 00:02:50,030
And then we'll set up the logic where if the verification token makes sense, then we're good to go.

42
00:02:50,480 --> 00:02:53,270
Then the user is verified again.

43
00:02:53,270 --> 00:02:59,510
We all start with the postman because I don't want to involve the email on a frontend yet, but it doesn't

44
00:02:59,510 --> 00:03:06,830
change the idea there is with email verification that you need to have this middle step not only register

45
00:03:06,830 --> 00:03:08,870
or login, but in between them.

46
00:03:08,870 --> 00:03:15,380
You have this verified email where you check whether token that the user is providing meaning.

47
00:03:15,380 --> 00:03:18,470
In this case, frontend is providing is correct.

48
00:03:18,770 --> 00:03:23,660
And the same goes for email and this is what we're going to work on in the next videos.

