1
00:00:08,100 --> 00:00:09,360
Everyone welcome back.

2
00:00:09,360 --> 00:00:11,450
Joining me here with those slopes dot com.

3
00:00:11,550 --> 00:00:16,190
And in this lesson we are going to work on logging in the user.

4
00:00:16,410 --> 00:00:22,620
So up till now the only way to kind of log in is to actually create an account.

5
00:00:22,890 --> 00:00:25,330
But I'm getting tired of creating accounts every single time.

6
00:00:25,350 --> 00:00:29,010
So we're going to get this whole logging issue fixed.

7
00:00:29,010 --> 00:00:30,320
All right so what.

8
00:00:30,630 --> 00:00:31,690
What do we need to do.

9
00:00:32,010 --> 00:00:37,620
Well Mr. Postman and I want to show you what what's going on here.

10
00:00:37,650 --> 00:00:43,370
So when we log in a user see here we can log in with this account.

11
00:00:43,500 --> 00:00:54,120
So when I log in what is returned to us is a token came and a user name and we save that into the user

12
00:00:54,120 --> 00:00:58,600
defaults for the user and the off token.

13
00:00:59,010 --> 00:01:05,130
But that doesn't give us the other information we need which is the user name the avatar image the background

14
00:01:05,130 --> 00:01:07,010
color and those other things.

15
00:01:07,020 --> 00:01:13,110
So the only one the only function that we have so far that gives us that information is when we add

16
00:01:13,140 --> 00:01:14,810
a user we get back.

17
00:01:14,970 --> 00:01:21,140
This chase on object right and that contains all of the user infor information that we need.

18
00:01:21,240 --> 00:01:25,220
So we're going to need a new function and the API provides us one.

19
00:01:25,220 --> 00:01:30,330
And that's that function is called the find use or by e-mail function.

20
00:01:30,330 --> 00:01:31,990
All right and so it's this route right here.

21
00:01:31,990 --> 00:01:40,440
So user by e-mail and then at the end you append the user's e-mail and that function actually returns

22
00:01:40,500 --> 00:01:43,440
the exact same Jaison as the add user.

23
00:01:43,520 --> 00:01:43,900
OK.

24
00:01:44,010 --> 00:01:48,250
So that gives us the ID abat color avatar name email and name.

25
00:01:48,300 --> 00:01:48,810
OK.

26
00:01:49,050 --> 00:01:50,400
So this is what we're going to work on.

27
00:01:50,400 --> 00:01:56,910
First we're going to create a new function that can go and fetch that information based just on the

28
00:01:56,910 --> 00:02:00,410
users email that we get after we log in and came.

29
00:02:00,600 --> 00:02:06,450
So we get the users email in off token then we use that e-mail and auto can to get the rest of their

30
00:02:06,450 --> 00:02:06,990
information.

31
00:02:06,990 --> 00:02:07,610
All right.

32
00:02:07,830 --> 00:02:09,330
So let's get to it.

33
00:02:09,330 --> 00:02:16,380
We're going to do this in the off service Dodsworth file sibb and come down here to the bottom and create

34
00:02:16,380 --> 00:02:17,190
a new function.

35
00:02:17,190 --> 00:02:23,720
We're going to call this funk find user by email Ken.

36
00:02:24,060 --> 00:02:28,950
And this one we don't actually need to pass anything into it except for.

37
00:02:28,980 --> 00:02:38,990
We're just going to have our completion handler I say at it's keeping it and completion handler.

38
00:02:38,990 --> 00:02:40,300
All right there we go.

39
00:02:40,800 --> 00:02:46,810
So first off let's go ahead and create our your all going to open.

40
00:02:46,860 --> 00:02:48,470
Run over to utilities.

41
00:02:48,470 --> 00:02:49,180
Where are you.

42
00:02:49,220 --> 00:02:50,130
Here you go.

43
00:02:50,180 --> 00:03:00,270
Constance And our next your health is called Let your underscore user by e-mail that is going to equal

44
00:03:02,160 --> 00:03:18,850
the base you are ill and then you some quotation marks base you are l and then user slash by email slash.

45
00:03:19,120 --> 00:03:26,320
And then over in our office service we're going to append to that the users email but we'll get to that

46
00:03:26,320 --> 00:03:27,450
in a second.

47
00:03:28,010 --> 00:03:28,470
All right.

48
00:03:28,480 --> 00:03:32,920
And we don't actually need a body we don't need to do any lowercase e-mail or anything.

49
00:03:32,920 --> 00:03:37,870
We will need the better header but we have that saved as a.

50
00:03:37,900 --> 00:03:39,040
Or do we.

51
00:03:39,370 --> 00:03:40,430
Oh no we do not.

52
00:03:40,530 --> 00:03:40,760
OK.

53
00:03:40,780 --> 00:03:44,320
So we need we're going to be using this header right here.

54
00:03:44,320 --> 00:03:46,890
And so since we'll be using it in multiple locations Go ahead.

55
00:03:46,900 --> 00:03:49,400
And I'm just going to cut this header.

56
00:03:49,410 --> 00:03:52,030
This is from the create user function.

57
00:03:52,030 --> 00:03:57,310
I'm cutting that header and we're going to jump down here to our hitter's section and I'm going to call

58
00:03:57,310 --> 00:03:59,260
this better.

59
00:04:01,180 --> 00:04:01,740
Header.

60
00:04:01,900 --> 00:04:08,590
OK because this is the header that contains the authorization token going to copy that and then go back

61
00:04:08,590 --> 00:04:10,690
to our service that swift.

62
00:04:11,200 --> 00:04:17,560
And here we're going to replace Heather here with barer header.

63
00:04:17,920 --> 00:04:18,990
OK.

64
00:04:19,540 --> 00:04:19,770
All right.

65
00:04:19,780 --> 00:04:25,570
So now we're back in the Find use or by e-mail we've created a constant for the bearer authorization

66
00:04:25,570 --> 00:04:29,610
token header and now we're going to create our find user by e-mail.

67
00:04:30,070 --> 00:04:39,010
Alamo of our request OK so the Alamo fire dot request and I'm going to use the same one we've been using

68
00:04:39,700 --> 00:04:44,350
this time although we're going to have to do a little bit of string interpolation.

69
00:04:44,350 --> 00:04:54,250
We're going to start with the your L by user or user or by email and then we are going to add onto that

70
00:04:55,180 --> 00:05:04,330
the user e-mail OK remember this function has been called directly after we call the log in a function

71
00:05:05,050 --> 00:05:10,510
right here which saves to our user defaults the user e-mail and the token.

72
00:05:10,510 --> 00:05:17,500
So that's why we have access to those in this function and the type is what is the type.

73
00:05:17,510 --> 00:05:18,910
It might be a.

74
00:05:18,940 --> 00:05:21,270
Actually yes so this function is actually a get.

75
00:05:21,420 --> 00:05:25,310
So this will be our one of our first methods here.

76
00:05:25,390 --> 00:05:31,920
So to do that we just say dupped get the parameters are at.

77
00:05:31,940 --> 00:05:35,230
No we don't have a body to pass this time.

78
00:05:35,230 --> 00:05:47,780
The encoding is Loeb's encoding is based on in coding that default and the headers is our constant Herter

79
00:05:47,800 --> 00:05:52,360
that we just created and the response is a response.

80
00:05:52,630 --> 00:05:54,270
Her response to Jaison.

81
00:05:54,460 --> 00:05:59,350
I'm going to press going to close the side pains to give this little bit more room and clicking here

82
00:05:59,770 --> 00:06:08,320
pressing enter and renaming the data response to just response and then getting rid of that placeholder

83
00:06:08,320 --> 00:06:09,650
for code.

84
00:06:09,850 --> 00:06:19,480
Okeydokey So now we are doing essentially exactly the same thing as we did in the create user function

85
00:06:19,480 --> 00:06:19,980
now.

86
00:06:20,220 --> 00:06:20,660
OK.

87
00:06:20,830 --> 00:06:29,410
So I could actually just copy this entire section here from the create user because the response and

88
00:06:29,410 --> 00:06:33,970
the sun is exactly the same like we saw in Postman.

89
00:06:34,000 --> 00:06:38,520
So here is the response for the add user.

90
00:06:39,070 --> 00:06:43,610
And here it is for the find user by email.

91
00:06:43,990 --> 00:06:44,640
OK.

92
00:06:44,980 --> 00:06:48,620
But we don't not want to violate the dry principle.

93
00:06:48,630 --> 00:06:48,960
Right.

94
00:06:48,970 --> 00:06:59,060
So what we need to do is we're going to go ahead and just extract out all of this right here.

95
00:06:59,360 --> 00:06:59,950
OK.

96
00:06:59,950 --> 00:07:02,060
So I'm going to cut this.

97
00:07:02,110 --> 00:07:12,070
We're going to create a new function called phunk set user info and into that we are going to pass data

98
00:07:12,730 --> 00:07:22,960
type data and then I'm going to paste what we just cut and then right up here where we cut it from I'm

99
00:07:22,960 --> 00:07:24,630
going to call that function that we just created.

100
00:07:24,660 --> 00:07:31,480
I mean to say self set the user info data and we're going to pass into it this data right here that

101
00:07:31,480 --> 00:07:34,150
we're getting from the response.

102
00:07:34,150 --> 00:07:34,520
All right.

103
00:07:34,540 --> 00:07:43,160
So basically all we're doing is if the response error isn't all we're going to extract the data from

104
00:07:43,160 --> 00:07:49,000
the response then we're going to pass that data into this function right here which is essentially the

105
00:07:49,000 --> 00:07:57,460
same thing that we did and our create user account or a function in which we extract the ID color avatar

106
00:07:57,460 --> 00:08:05,650
name email name past those into the function over in our user data service which is used to set the

107
00:08:05,920 --> 00:08:10,720
private privately set variables inside of our user data service.

108
00:08:10,840 --> 00:08:11,830
Okay.

109
00:08:11,830 --> 00:08:17,030
And then appear in our create user we can do a little bit of refactoring here as well.

110
00:08:17,140 --> 00:08:27,730
So I can delete this and say self not set user info data and then Pessin the data right there as well.

111
00:08:27,730 --> 00:08:29,730
All right so we're going to save that.

112
00:08:30,850 --> 00:08:39,700
And now we have a way at any point to as long as we have a valid email to make an API request and retrieve

113
00:08:39,820 --> 00:08:43,780
the information for that for any specific user.

114
00:08:43,810 --> 00:08:46,550
Just by passing in the users e-mail right here.

115
00:08:46,600 --> 00:08:47,190
OK.

116
00:08:47,380 --> 00:08:55,000
So let's let's use that over here in the log in view controller and we haven't actually done much working

117
00:08:55,000 --> 00:09:00,040
here so we're going to need to add a bunch of outlets and do some work here.

118
00:09:00,040 --> 00:09:01,760
All right so the go ahead and do that.

119
00:09:02,270 --> 00:09:08,320
First let's go ahead and add a spinner and just like we did in our create an account we're going to

120
00:09:08,500 --> 00:09:18,890
win our right pane search for activity indicator and I'm going to just drop that in right here and we're

121
00:09:18,890 --> 00:09:24,230
going to say look this attributes inspector said the style to large white and then change the color

122
00:09:24,230 --> 00:09:31,520
to our purple that we've been using then I'm going to select the line constraint right here and say

123
00:09:31,550 --> 00:09:38,470
horizontal and vertical in container and then I'm going to go to the size inspector and select the align

124
00:09:38,480 --> 00:09:42,630
center to Y and enter in minus 100 as a constant.

125
00:09:42,770 --> 00:09:48,320
And that just pop it up for us right there that looks good.

126
00:09:48,800 --> 00:09:53,720
And I'm going to save that and then I'm going to open up our assistant editor by holding option and

127
00:09:53,720 --> 00:10:02,390
clicking on the log and we see right here we go and we are going to need outlets for the username password

128
00:10:02,660 --> 00:10:04,020
and the spinner.

129
00:10:04,190 --> 00:10:14,440
OK so can I create a little section for outlets and the user name label or text field selected and control

130
00:10:14,480 --> 00:10:15,340
dragging.

131
00:10:15,500 --> 00:10:25,010
And I'm going to call this user name text it connect and for the password same thing control drag and

132
00:10:25,010 --> 00:10:28,990
I'm going to save password text to 60.

133
00:10:29,960 --> 00:10:39,620
And finally for the spinner I'm going to control drag and say spinner I'm going to connect those.

134
00:10:40,460 --> 00:10:46,180
And then see here close pressed created Count button looks like we also need a log in.

135
00:10:46,600 --> 00:10:47,030
OK.

136
00:10:47,180 --> 00:10:54,970
So we're going to just put that right here holding log in control dragging and I'm going to say loggin

137
00:10:55,150 --> 00:10:56,140
pressed.

138
00:10:56,200 --> 00:10:58,260
Change that to an action.

139
00:10:58,310 --> 00:10:59,240
And that looks good.

140
00:10:59,240 --> 00:11:02,150
So connect.

141
00:11:02,150 --> 00:11:08,560
All righty then let's go ahead and go back to our standard editor and let's get to work.

142
00:11:08,570 --> 00:11:17,100
So let's jump back into our log NBC and do a little bit of you I said up first just like in our create

143
00:11:17,100 --> 00:11:23,270
a count b c we're going to want to change the placeholder text of of these two text fields.

144
00:11:23,360 --> 00:11:34,310
So let's create a function for setting up the Wii U and I say phunk set up a new hand instead of writing

145
00:11:34,310 --> 00:11:35,000
all that out.

146
00:11:35,000 --> 00:11:41,630
Again I'm just going to go back into our create a count b c and steal a couple of these and I'm going

147
00:11:41,630 --> 00:11:45,710
to copy that and jump back into the log in VC and paste that.

148
00:11:45,860 --> 00:11:55,460
And then just replace looks like that was already the same and replace this one here username and change

149
00:11:55,520 --> 00:11:59,820
the placeholder text to password.

150
00:12:00,800 --> 00:12:02,050
And that should be good.

151
00:12:02,060 --> 00:12:04,320
And then we're going to hide the spinner to start out.

152
00:12:04,460 --> 00:12:10,140
So spinner is hidden is equal to true.

153
00:12:10,700 --> 00:12:12,650
And I'm going to save that.

154
00:12:13,370 --> 00:12:18,650
So now the last thing in our log in the see that we need to do is that well first we need to of course

155
00:12:18,890 --> 00:12:20,560
call the function that we just created.

156
00:12:20,570 --> 00:12:22,900
I always forget that one set up you right here.

157
00:12:22,970 --> 00:12:25,230
All right and then here for the log impressed.

158
00:12:25,400 --> 00:12:28,470
So what's going to happen when we press the button.

159
00:12:28,490 --> 00:12:36,650
We are first going to log the user in with the username and password that they entered then we are going

160
00:12:36,650 --> 00:12:44,750
to go through the off service type instance a logging user where we will log in through the API which

161
00:12:44,750 --> 00:12:53,210
will return to us the users email and the token we save those into service and then we use the find

162
00:12:53,210 --> 00:13:01,040
user by email to go ahead and populate all of our user data service information that we need to do things

163
00:13:01,040 --> 00:13:06,620
like show the avatars images and usernames et cetera.

164
00:13:06,620 --> 00:13:07,010
All right.

165
00:13:07,100 --> 00:13:10,110
So let's go ahead and get started.

166
00:13:10,220 --> 00:13:12,380
First thing we're going to do is say spinner

167
00:13:15,360 --> 00:13:17,900
is hidden is equal to false.

168
00:13:18,000 --> 00:13:21,960
So once we click it the spinner is going to pop up and we're going to start it and the meetings I'm

169
00:13:21,960 --> 00:13:32,760
going to say spinner that is animating or I should say start animating spinner to start animating.

170
00:13:33,290 --> 00:13:39,060
And then we are going to make our then run unwrap our username and password.

171
00:13:39,060 --> 00:13:45,800
So when I say guard let my username is equal to user name

172
00:13:49,430 --> 00:13:58,140
text come on use a name text dot text where and this is just to do a check to make sure that we have

173
00:13:58,380 --> 00:14:08,650
that we don't have an empty string and I say user name text text does not equal an empty string and

174
00:14:08,650 --> 00:14:10,580
it closes right pane.

175
00:14:10,750 --> 00:14:17,970
Else we are just going to return out of this function and then same thing for the password.

176
00:14:17,980 --> 00:14:24,280
So I'm going to copy this and paste it and say Pass is equal to.

177
00:14:24,870 --> 00:14:29,940
Copy this password text that text where past for text or text is not equal to an empty string.

178
00:14:30,030 --> 00:14:31,210
Else return.

179
00:14:31,650 --> 00:14:34,180
OK so then we can call our loggin function.

180
00:14:34,240 --> 00:14:40,880
When I say service instance dot loggin user.

181
00:14:41,070 --> 00:14:44,190
And we're going to pass into it the user name.

182
00:14:44,190 --> 00:14:47,910
So this is actually I mean these poorly.

183
00:14:47,910 --> 00:14:50,130
The user name is not actually the user's name.

184
00:14:50,130 --> 00:14:52,180
The user name is the e-mail.

185
00:14:52,860 --> 00:14:53,580
But that's OK.

186
00:14:53,750 --> 00:14:55,360
This should actually be e-mail.

187
00:14:55,380 --> 00:14:58,440
So I'm going to change this right here to e-mail.

188
00:14:58,440 --> 00:14:58,980
There you go.

189
00:14:59,190 --> 00:15:01,980
All right so e-mail M-Pesa and the e-mail pass.

190
00:15:02,000 --> 00:15:10,290
We're going to pass and pass them for the completion händler press enter to get our going to say success

191
00:15:11,100 --> 00:15:13,000
and get rid of that.

192
00:15:13,100 --> 00:15:21,180
So when I say if success so if the logon is successful then we are going to use our brand new function

193
00:15:21,180 --> 00:15:23,970
that we just created the find user by email.

194
00:15:24,030 --> 00:15:36,030
Ok so when I say off service instance dot fine use or by e-mail completion is access and if it's successful

195
00:15:36,140 --> 00:15:45,250
and if success then we have repopulated our user data service information.

196
00:15:45,270 --> 00:15:50,210
We now have the Avatar color name the user name and email.

197
00:15:50,250 --> 00:15:50,700
OK.

198
00:15:50,850 --> 00:15:52,380
So that's great news.

199
00:15:52,380 --> 00:15:58,110
And so at this point and we've we've logged in what we want to do is we're going to send out our post

200
00:15:58,170 --> 00:16:06,740
notification to let everybody know who cares that we have logged in that the user data has changed.

201
00:16:06,750 --> 00:16:13,950
So that's a good notification center that default dot post and see here.

202
00:16:14,100 --> 00:16:18,590
And this is the one we want right here.

203
00:16:18,660 --> 00:16:25,270
So the name is known to have underscore you the data did change and the object is new.

204
00:16:25,550 --> 00:16:25,860
OK.

205
00:16:25,860 --> 00:16:27,690
Can say that.

206
00:16:27,750 --> 00:16:29,390
And then just a few of the things that we want to do.

207
00:16:29,400 --> 00:16:34,920
We're going to say self that spinner that is

208
00:16:37,650 --> 00:16:41,780
hid in is equal to true self that spinner.

209
00:16:44,180 --> 00:16:45,760
Stop animating.

210
00:16:45,800 --> 00:16:53,780
And then lastly we're going to dismiss so self-taught dismiss animated as true and completion as well.

211
00:16:53,810 --> 00:16:54,030
All right.

212
00:16:54,030 --> 00:16:56,050
Wonderful to save that.

213
00:16:56,540 --> 00:17:03,230
And I think that's actually everything that we need here in the log and B C for now and forever actually.

214
00:17:03,230 --> 00:17:05,050
So I think this one is done.

215
00:17:05,370 --> 00:17:08,500
Yeah let's go ahead and test it out I'm going to run it.

216
00:17:08,630 --> 00:17:09,290
All right.

217
00:17:09,300 --> 00:17:23,820
So when I open this up press log in and log in here at E dot dot com password 1 2 3 4 5 6 and log in

218
00:17:24,620 --> 00:17:26,610
spinner up just like we wanted.

219
00:17:27,050 --> 00:17:29,210
Oh hey there we go.

220
00:17:29,210 --> 00:17:35,810
All right so we are successfully logging in or going to log out and just try that one more time with

221
00:17:35,810 --> 00:17:38,540
a different g g dot com.

222
00:17:38,540 --> 00:17:41,720
One two three four five six.

223
00:17:41,880 --> 00:17:43,140
And there we go.

224
00:17:43,140 --> 00:17:47,310
All right so we have logging in covered.

225
00:17:47,490 --> 00:17:47,720
OK.

226
00:17:47,730 --> 00:17:54,090
But I want to show you something if you do commence shift and go H.H. then you get this here so I'm

227
00:17:54,090 --> 00:17:58,650
going to close our app so close it and then I'm going to reopen it.

228
00:17:58,650 --> 00:17:59,790
Now we were logged in right.

229
00:17:59,790 --> 00:18:02,210
We were logged in as Johnny B.

230
00:18:02,220 --> 00:18:10,920
So I just reopened it and you would expect you know from your normal use of other apps that we would

231
00:18:11,120 --> 00:18:12,810
you know still be logged in.

232
00:18:13,290 --> 00:18:19,800
And we kind of are because if you see here the Boullion is still set saying that we're logged in but

233
00:18:19,800 --> 00:18:23,000
we don't have any of our user info or anything.

234
00:18:23,010 --> 00:18:24,660
So we need to fix that.

235
00:18:24,660 --> 00:18:27,120
So we're going to do that is here in our chat.

236
00:18:27,130 --> 00:18:34,790
See what we're going to do is when we load up the app we're going to go ahead and just do a check.

237
00:18:34,970 --> 00:18:40,320
So I guess we're going to do a check if we're logged in and if we are then we're going to go ahead and

238
00:18:40,320 --> 00:18:46,780
call that function the find use or by email do our post notification that user data has changed.

239
00:18:46,920 --> 00:18:50,720
And that should that should get us going in the right directions.

240
00:18:50,730 --> 00:19:02,180
I want to say if off service come on if off the service that instance that is logged in to if we are

241
00:19:02,180 --> 00:19:10,060
logged in then we are going to call the office service instance dot find use or by email function.

242
00:19:10,350 --> 00:19:10,800
OK.

243
00:19:11,020 --> 00:19:12,760
Success.

244
00:19:12,770 --> 00:19:21,290
And so here we going to do is post the notifications saying that we have logged in so user data has

245
00:19:21,290 --> 00:19:21,940
changed.

246
00:19:22,100 --> 00:19:31,700
So notification center dot default dot post and the notification that were posting that were the name

247
00:19:31,700 --> 00:19:41,570
of the broadcast that we are blasting out is no underscore user data did change object is no case going

248
00:19:41,600 --> 00:19:42,710
to save that.

249
00:19:42,990 --> 00:19:45,000
OK so this is all hunky dory.

250
00:19:45,020 --> 00:19:54,750
But if we come in to our channel ABC this this this view might not have been instantiated at the time

251
00:19:54,750 --> 00:19:56,560
that that notification is fired off.

252
00:19:56,610 --> 00:20:06,060
So we also need to do is here in my view did appear we need to do a check and set up the user data accordingly.

253
00:20:06,060 --> 00:20:11,350
So in other words we need to do everything that is being done right here.

254
00:20:11,440 --> 00:20:18,090
And you did appear so let's go ahead and create a function for that someone to say phunk set up user

255
00:20:18,180 --> 00:20:24,200
info and to just copy her cut everything out of this.

256
00:20:24,210 --> 00:20:27,280
Usually they did change and put you right here.

257
00:20:27,390 --> 00:20:37,790
And then I'm going to call set up user info here and here in view did appear that way if we're opening

258
00:20:37,790 --> 00:20:46,610
up the app from scratch chat we see loads up the end and we have been logged in previously so our token

259
00:20:46,610 --> 00:20:48,380
e-mails are saved.

260
00:20:48,390 --> 00:20:55,490
We're going to find our user information and then when we open up channel ABC here on view did appear

261
00:20:55,550 --> 00:21:01,880
we're going to do a check here and we're going to say Oh hey I have everything that I need to set up

262
00:21:01,880 --> 00:21:04,800
the user info for a logged in user.

263
00:21:04,860 --> 00:21:05,290
OK.

264
00:21:05,360 --> 00:21:07,580
So let's go in and run that and test it.

265
00:21:08,210 --> 00:21:13,190
And I think we ended with a logged in users so we up and there we go all around.

266
00:21:14,180 --> 00:21:22,820
So from a fresh start we we loaded up we got our our user information via that new function that we

267
00:21:22,820 --> 00:21:26,400
created and loaded up all of our eyes accordingly.

268
00:21:26,420 --> 00:21:34,730
So that's pretty exciting and if I log out then it goes back and if I close the app and then re open

269
00:21:34,730 --> 00:21:35,170
it.

270
00:21:35,270 --> 00:21:38,240
All right and I guess I didn't actually close it.

271
00:21:38,420 --> 00:21:39,160
See here.

272
00:21:39,330 --> 00:21:47,430
So closing it and then reopening it and everything should be blank.

273
00:21:47,750 --> 00:21:58,210
So then we can log in again at 1 One two three four five six and boom.

274
00:21:58,280 --> 00:22:01,420
All right so great.

275
00:22:02,030 --> 00:22:04,300
So we have this lesson.

276
00:22:04,340 --> 00:22:11,310
We created a new function so that we could get the users information based off of their e-mail.

277
00:22:11,540 --> 00:22:18,770
And then with that information we were able to set it so that we can log in users from the logging page

278
00:22:18,770 --> 00:22:24,940
instead of having to do the whole create account cycle every single time we wanted to log in.

279
00:22:25,040 --> 00:22:30,290
And then we also set it up to where if you're launching it from scratch and you have already logged

280
00:22:30,290 --> 00:22:32,950
in and in the past you don't have to log in again.

281
00:22:32,990 --> 00:22:34,120
Now it just logs you.

282
00:22:34,130 --> 00:22:36,070
Logs logs you in automatically.

283
00:22:36,080 --> 00:22:37,250
So that's really nice.

284
00:22:37,250 --> 00:22:39,140
All right so we're making great progress.

285
00:22:39,140 --> 00:22:45,560
I know you guys are probably itching to start actually working with web sockets and the actual chat

286
00:22:46,670 --> 00:22:49,750
part of this app but sorry about that.

287
00:22:49,760 --> 00:22:56,780
But this has been a lot of lead up to get into it and but I mean we've learned a ton so far learned

288
00:22:56,780 --> 00:23:01,190
a lot about web requests using El-Amir fire and working with API and everything.

289
00:23:01,190 --> 00:23:02,730
So yeah I hope you guys are having fun.

290
00:23:02,760 --> 00:23:09,800
And just to finish off here I'm going to add our progress make sure that you are doing the same on your

291
00:23:09,800 --> 00:23:12,940
end and I will see you all in the next one.
