1
00:00:00,170 --> 00:00:00,560
All right.

2
00:00:00,560 --> 00:00:08,119
And before we set up the Http only cookie, let's also add two more values to our dot env.

3
00:00:08,620 --> 00:00:11,270
And first one is going to be this secret one.

4
00:00:11,420 --> 00:00:14,390
And second, we'll add this expires in.

5
00:00:14,540 --> 00:00:23,060
Now normally you want also something more complex than just the string of secret, but since in my case

6
00:00:23,060 --> 00:00:28,430
you can see all the values that I'm typing anyway, of course I'll just keep it as secret.

7
00:00:28,430 --> 00:00:34,220
But again, normally you want something that's more complex, so come up with some kind of random string

8
00:00:34,220 --> 00:00:39,890
or whatever, and essentially you will just keep it here on the server and you'll use that value to

9
00:00:39,890 --> 00:00:45,220
decode the JWT that we're creating over here.

10
00:00:45,230 --> 00:00:46,860
Hopefully that is clear.

11
00:00:46,880 --> 00:00:49,420
Also, make sure that you restart the server.

12
00:00:49,430 --> 00:00:50,930
That's very, very important.

13
00:00:50,930 --> 00:00:53,600
So first let's navigate to.

14
00:00:54,280 --> 00:00:55,090
Don't envy.

15
00:00:55,120 --> 00:00:56,770
We're looking for JWT.

16
00:00:56,860 --> 00:01:00,400
And in my case, I'm going to call this secret again.

17
00:01:00,670 --> 00:01:05,740
I'm not going to repeat the same speech, but I'm going to go with secret.

18
00:01:05,740 --> 00:01:09,430
And also we're going to go with JWT underscore.

19
00:01:10,370 --> 00:01:15,220
Spires underscore in and we'll set it equal to one day.

20
00:01:15,250 --> 00:01:18,220
Then we want to navigate to token utils.

21
00:01:18,970 --> 00:01:23,800
We have access to the environment variables since we have the package.

22
00:01:23,800 --> 00:01:33,520
So we'll simply go here with process dot env and then dot and then JWT underscore secret.

23
00:01:33,820 --> 00:01:36,670
And the same of course works for this one as well.

24
00:01:36,670 --> 00:01:43,210
So we're going to go with process dot env dot and then JWT expires.

25
00:01:43,970 --> 00:01:47,030
In, make sure you restart the server.

26
00:01:47,030 --> 00:01:48,770
So let me stop it over here.

27
00:01:48,800 --> 00:01:54,590
NPM run dev and with this in place we are ready to move on to the next step.

