1
00:00:00,770 --> 00:00:08,000
Less display an error for unauthorized user, and that is for the profile page.

2
00:00:08,000 --> 00:00:13,310
Unless you are logged in before you can view your profile page.

3
00:00:13,310 --> 00:00:20,240
So when I click on this one, you can see that I have my profile page and then this is it.

4
00:00:20,240 --> 00:00:21,920
You are error for that.

5
00:00:22,040 --> 00:00:29,180
And let's say that a user is not logged in, but trying to have access to the profile page.

6
00:00:29,210 --> 00:00:30,500
Let's have a look.

7
00:00:30,530 --> 00:00:38,170
We have implemented the logic at the back end and that is is going to display that you are not looking

8
00:00:38,180 --> 00:00:39,500
or not authorized.

9
00:00:39,500 --> 00:00:45,650
So let me go ahead and then copy the endpoint or the you are error for the profile.

10
00:00:47,180 --> 00:00:48,980
And let me look out.

11
00:00:50,330 --> 00:00:58,220
And let me pace the endpoint for the profile, and that is the API version one user and profile page

12
00:00:58,220 --> 00:00:59,330
and hit send.

13
00:00:59,660 --> 00:01:05,480
And you can see we have this message from the back end and that is not authorized.

14
00:01:05,480 --> 00:01:07,070
Log in again.

15
00:01:07,130 --> 00:01:13,430
So how can we display some beautiful message to the user that place you are not authorized.

16
00:01:13,430 --> 00:01:15,920
So let's see how we are going to achieve that.

17
00:01:15,950 --> 00:01:19,550
Definitely we are going to render a template.

18
00:01:19,550 --> 00:01:27,770
So let's locate where we have this error and inside the back end, and that is the metaverse and protected.

19
00:01:27,950 --> 00:01:30,710
This is a message that got rendered.

20
00:01:30,710 --> 00:01:33,620
So how are we going to display a template?

21
00:01:33,620 --> 00:01:42,170
So as always, I'll provide the final template for you and I'm going to copy and paste it inside the

22
00:01:42,170 --> 00:01:42,860
views.

23
00:01:42,860 --> 00:01:49,550
So views users and our that and it's called not authorized dot HTML.

24
00:01:49,550 --> 00:01:53,690
And let me rename this one to Aegis.

25
00:01:55,530 --> 00:01:56,160
Perfect.

26
00:01:56,280 --> 00:02:04,110
The next step is that I need to add the CCS 4/8, and it's called Access Denied CSIS.

27
00:02:04,110 --> 00:02:09,090
So I'm going to paste it inside the public and then the CSIS.

28
00:02:09,570 --> 00:02:14,460
And let's look at the templates and let's require the CSIS.

29
00:02:18,480 --> 00:02:19,560
Oh, right.

30
00:02:19,800 --> 00:02:23,220
Next step is that Let's go ahead and then render that.

31
00:02:23,220 --> 00:02:31,740
So here, instead of returning this JSON data, we are going to render the template as a rest render

32
00:02:32,190 --> 00:02:38,370
and we pass in the template as users forward slash not authorized.

33
00:02:41,570 --> 00:02:43,660
All right, moment of truth.

34
00:02:43,670 --> 00:02:45,800
So let's refresh it and let's see.

35
00:02:46,100 --> 00:02:52,660
And you can see that not authorized by the image I use is not showing here.

36
00:02:52,670 --> 00:02:55,400
So let me go ahead and use it.

37
00:02:55,400 --> 00:02:57,950
So the image is called look.

38
00:02:57,950 --> 00:03:03,050
So our copy that and inside the public.

39
00:03:03,800 --> 00:03:07,220
And images outpace that look.

40
00:03:07,280 --> 00:03:13,190
And let me get back to the authorized and use the image instead of this.

41
00:03:13,190 --> 00:03:15,450
I'm going to make use of you.

42
00:03:15,470 --> 00:03:19,760
Move this one forward slash images and look at JPEG.

43
00:03:20,880 --> 00:03:22,410
And here we go.

44
00:03:22,530 --> 00:03:24,510
When I click on Go Back.

45
00:03:24,510 --> 00:03:26,670
And indeed, I'm back.

46
00:03:27,120 --> 00:03:27,840
All right.

47
00:03:27,840 --> 00:03:31,000
We are improving the user experience.

48
00:03:31,020 --> 00:03:33,030
Let's continue in the next video.

