0:00:21
what is going on guys welcome back to
0:00:28
are we feeding today
0:00:36
i'm very good man very good
0:00:41
uh so i just played the um
0:00:43
acknowledgment of the country and pay
0:00:45
our respects to the elders of the past
0:00:47
present and future
0:00:51
i begin today by acknowledging the
0:00:53
traditional custodians of the land on
0:00:55
which we gather today and pay my
0:00:57
respects to the elders past present and
0:01:00
future i extend their respect to
0:01:02
aboriginal and torres strait islander
0:01:24
that's cute yeah all right um
0:01:34
whoa take care about that yeah
0:01:39
um yeah just another another good day
0:01:44
um yeah so sorry about it yes today i
0:01:47
couldn't really make it was um
0:01:50
having a meeting so which is why
0:01:56
what did we go to yesterday
0:02:05
hey gective how are you um i explained
0:02:09
to thanesh what we had done the day
0:02:12
i'll remind everybody was
0:02:20
ui for the password form on the boards
0:02:23
page so when you click save um it would
0:02:29
i spent probably like
0:02:32
thanksgiving good to see you too um
0:02:40
uh sorry i lost my train of thought yeah
0:02:42
so i spent like after our show on
0:02:46
spent another like maybe 30 minutes
0:02:48
after the show to kind of finish up
0:02:51
that part of the ui and hook up the
0:02:57
and so that is done
0:03:00
and then i went over that with the nash
0:03:04
and then he asked me a question about
0:03:06
a potential bug on the page
0:03:09
and so i explained it to him that there
0:03:13
that when you save the notes sometimes
0:03:16
it doesn't save them correctly in
0:03:20
so we kind of discussed that and
0:03:24
maybe some of the potential reasons and
0:03:31
mitigate that issue
0:03:34
we just wrote a little
0:03:36
client-side code for the future
0:03:43
maybe a potential fix um
0:03:47
and i can go over that with you what we
0:03:51
it's written but it's not executed
0:03:54
it's just dead code
0:04:04
is either works or it's about to work
0:04:09
oh i mean it's turned it's like it's not
0:04:11
executed like it doesn't do anything at
0:04:14
the moment okay all right i see i see
0:04:18
cool so do you want to share the screen
0:04:23
unless you want to code um
0:04:36
i'll let you be the
0:04:50
where does that go
0:04:52
finish that one right
0:05:05
the bug that we were talking about
0:05:10
hopefully this launches
0:05:13
with great bores come a great amount of
0:05:37
well i guess i guess you didn't get to
0:05:43
that stuff we were working on
0:05:49
so i finished that up as well
0:05:57
i'll just walk you through the code so
0:05:59
when you load the boards page
0:06:01
then you grab that
0:06:04
passcode ui div in the html and then you
0:06:08
load the little snippet you made
0:06:12
and then we add this uh
0:06:16
click listener with
0:06:24
uh we have some javascript with jquery
0:06:30
so this shows the uh
0:06:32
this shows the form and the passcode ui
0:06:36
um with the show which i think just
0:06:39
applies some css styles but i just
0:06:43
use the jquery because it was already
0:06:49
and then we attach
0:06:52
um an event listener
0:06:56
well what happened what what's going on
0:07:01
just added like a gazillion lines of
0:07:07
what the heck i've never seen this
0:07:12
do i answer a page of notes of
0:07:23
that is very strange
0:07:30
going really well yeah
0:07:40
enjoying a lot as well
0:07:46
so then we attach a submit listener to
0:07:49
that form for the passcode ui and then
0:07:55
we get the passcode
0:07:57
from the form when submitted
0:08:02
then we validate the credentials
0:08:12
check if it's a valid passcode if it's
0:08:16
have that little alert box say invalid
0:08:19
yes we did do welcome to the contra
0:08:23
um and if it's successful then we set
0:08:38
say the board notes are saved
0:08:41
successfully and then we hide the form
0:08:47
looking pretty cool though
0:08:51
uh yeah pretty pretty um pretty cool it
0:09:00
if we go into this post patch notes on
0:09:04
um this is this is all the dead code
0:09:06
okay that's stuff we talked that's the
0:09:08
stuff i did yesterday with dinesh
0:09:16
we were talking about refactoring this
0:09:18
whole thing here this whole
0:09:21
loop with posting and patching notes
0:09:25
and what we said is
0:09:31
instead is make one post request
0:09:34
and put all the notes in the one post
0:09:38
and then just hand it like just kind of
0:09:40
refactor the back end to just handle
0:09:45
um we can send the password along with
0:09:52
this post this post notes function that
0:09:54
i just made yesterday
0:09:57
like doesn't do anything as i said
0:10:00
so we could just send all the notes
0:10:04
in that one post request with the
0:10:08
and that way we can protect that route
0:10:10
basically if it doesn't have the
0:10:12
passcode and it's not validated on the
0:10:14
back end then it won't update dynamodb
0:10:21
more efficient because we only have to
0:10:23
send one request with all the notes
0:10:28
and i think that has something to do
0:10:31
with the bug if this is let me see it's
0:10:36
all right live share so
0:10:40
demonstrate because it's not
0:10:43
always happening but maybe you noticed
0:10:45
it is when you save sometimes it doesn't
0:10:50
okay no it is that and yes that is
0:10:59
and that the way you're saying that i
0:11:01
think that would be
0:11:04
kind of a good way to
0:11:07
fix it as in just having one post
0:11:14
i don't know the reason for the bug but
0:11:17
it might be because we're slamming
0:11:19
dynamodb with all these different
0:11:21
requests all at once
0:11:23
and then it's uh it's like a list type
0:11:26
in dynamodb so it may be like
0:11:30
overwriting the list and then again it's
0:11:33
getting overwritten and overwritten but
0:11:35
i don't know if it's a
0:11:37
like a transaction concurrency issue or
0:11:41
something like that
0:11:42
yes so that was one thing that was in my
0:11:45
mind that i i didn't bring up because we
0:11:48
weren't on that stage
0:11:51
um until now but seems like we are now
0:11:55
so i did observe you know how we keep on
0:11:59
clicking the save button and it only
0:12:04
saved successfully
0:12:08
no matter how many
0:12:10
times we click it it just
0:12:13
gives us a success message
0:12:15
i'm thinking to make that um
0:12:20
logic and the ui part of it a bit a bit
0:12:25
so say as soon as the person clicks
0:12:37
a transit transitional
0:12:40
progress bar or loading view will come
0:12:45
saving these way so in that way the user
0:12:50
can actually be patient and so okay it's
0:12:53
doing the work i just have to wait
0:12:56
because i think what's happening now is
0:12:59
that as soon as we press save it does
0:13:03
save it as in the time it takes to
0:13:08
go to the db and then come back it
0:13:10
doesn't show any interaction with the
0:13:17
which is when the user may become
0:13:20
impatient hang on why is he not saving
0:13:24
in that transition and then end up
0:13:27
pressing this save button i don't know
0:13:30
five times or two times
0:13:32
well i thought that was i thought that
0:13:34
may have been an issue but it's
0:13:36
unfortunately it's not because even with
0:13:41
um where you have to enter in the
0:13:43
passcode which slows you down
0:13:44
dramatically we can still recreate the
0:13:50
right okay um yeah dave is saying
0:13:53
something really interesting here
0:13:59
isn't suitable to store data that
0:14:01
doesn't have the bounded size
0:14:03
and if we try to change the item to be
0:14:09
then we're just storing
0:14:12
what i don't any of these notes
0:14:15
oh and i so can a list be considered one
0:14:21
but even still like with this net with
0:14:24
this board here and these two notes
0:14:33
but yeah um that is a good um
0:14:37
thing to consider so thanks geckdiv
0:14:40
let's see if i can recreate the bug for
0:14:49
i like this submit button
0:14:52
i just bought it from that
0:14:54
the list you're using is the data type
0:14:56
like number or string
0:15:03
the list you're using is a data type
0:15:05
like number or string
0:15:08
it's still in an item
0:15:13
ah so the list is in an item so here
0:15:18
is an item that's a board
0:15:27
gotcha so 400 kb limits of plot um
0:15:35
as well not the individual
0:15:40
objects whatever inside of the list
0:15:45
how about if you try and save i think if
0:15:57
actually prints out the size of the item
0:16:00
we're just trying to save
0:16:05
i don't know if that's how much of that
0:16:09
vaguely remembering i did see some size
0:16:20
probably an issue for this problem it's
0:16:23
just something to be aware of so yeah
0:16:25
thanks again it's a good reminder
0:16:29
um uh can we i think we can see the size
0:16:34
or i mean the size of stuff in dynamodb
0:16:37
like through the ui too
0:16:40
yeah let me just have a look
0:16:45
is that's it's pretty big
0:16:49
it says absolutely
0:16:53
like these are just some simple notes i
0:17:44
a rough estimate is one
0:17:46
bite not kilobyte bite one one
0:17:48
thousandth of a kilobyte per per letter
0:17:52
in a roman alphabet like english so
0:18:02
it's not difficult again please i wasn't
0:18:05
following you at the time i was oh i
0:18:07
just i i was just curious how
0:18:12
how many bites is each letter like
0:18:17
like in storage right so
0:18:22
according to one website it's like each
0:18:25
letter so like the letter a would be
0:18:27
about one byte not kilobyte but byte
0:18:31
so you would have to have a thousand
0:18:33
letters on average to have one kilobyte
0:18:38
that's why i was saying
0:18:39
for these simple little notes 400 would
0:18:45
i guess so no different too so
0:18:53
so what i've got in the dynamodb
0:18:57
argument you're having with dinesh where
0:18:59
you're saying there could be
0:19:00
50 plus requests per note sorry what are
0:19:04
objective just trying to read objectives
0:19:09
i called you gekko i'm insane
0:19:18
um so it so at the moment we have got
0:19:21
two items in our table
0:19:24
and the average item size is 288.5
0:19:36
yeah but i guess um at the moment
0:19:40
we have to bear in mind that we've only
0:19:45
the more the notes are added the more
0:19:48
size will increase
0:19:53
yeah but i wouldn't worry about it at
0:19:55
the moment you would have to
0:19:57
you would have to probably like i don't
0:19:59
even think you can fill the page with
0:20:05
well what's the original issue that
0:20:08
we were too on discussing now as in i'm
0:20:14
make it happen it's just hard to
0:20:22
what you were basically saying uh is
0:20:27
try to save it it doesn't save you on
0:20:29
the first instance
0:20:31
is it no it it does save it just
0:20:36
oh sometimes fails
0:20:40
and i think i think it has to do with
0:20:43
the amount of requests that are getting
0:20:49
because for each note you're sending one
0:20:56
for each note i can't yeah it's hard but
0:20:59
i got it to work with the nesh last
0:21:05
okay i'm happy if it's not happening
0:21:08
maybe we can make a note of it and just
0:21:13
remember it at the back of our minds
0:21:16
and if it does happen then we will come
0:21:19
back to it then basically
0:21:30
a pretty simple fix i think
0:21:33
if it was something you wanted to
0:21:35
implement because all we have to do
0:21:40
have on the back end just get overwrite
0:21:46
attribute for the notes like just
0:21:48
overwrite the list
0:21:52
um because you'd be sending all the
0:21:54
notes with the request and that way too
0:21:57
when you send the notes
0:22:00
um you can send the passcode along and
0:22:03
you don't have to you only have to add
0:22:05
it for that route to verify it with
0:22:12
you could actually save a lot of code
0:22:15
that way and it'd actually make the
0:22:17
front end more performant because
0:22:20
you're not sending all these fetch
0:22:22
requests you're just sending one fetch
0:22:29
yeah yeah that would make a lot of sense
0:22:39
yeah right now it's one patch or post
0:22:44
yeah we would we would actually
0:22:45
eliminate a lot of code
0:22:52
i mean i don't you get a million free
0:22:59
theoretically it could save money
0:23:02
you're only going to fire up one lambda
0:23:07
50 lambdas if there's 50 notes
0:23:16
less api gateway requests less
0:23:20
dynamodbc yeah less dynamodb rights
0:23:30
yeah we will go down that path event
0:23:37
what's gonna happen now is basically
0:23:40
uh we've done this saving the notes on
0:23:46
we are getting it fine
0:23:48
as well right as in getting the board
0:23:53
are you getting the board
0:23:57
what do you mean uh from as in when we
0:24:00
type in the board there or freddy is
0:24:03
this and the password and press go then
0:24:06
it actually takes us to the
0:24:10
displays the notes yeah
0:24:17
i believe this we already did this part
0:24:22
uh i'm just confirming by the way
0:24:25
yeah i don't i don't know
0:24:28
actually yeah it looks like it works
0:24:30
yeah perfect then in that case our
0:24:45
for now there's one thing i don't know
0:24:47
if it matters to you or not
0:24:50
but when you post and patch so
0:24:57
when you do this post and patch notes on
0:25:00
save you're not sending the passcode
0:25:04
with these requests to be validated on
0:25:13
anybody who wants to be a jerk can just
0:25:18
and posts without the passcode and still
0:25:21
be able to update the the board but i
0:25:23
don't know if that matters to you or not
0:25:27
right right right right right
0:25:29
so basically what you're saying is that
0:25:32
the pass code is just there for
0:25:39
anything to do with
0:25:49
be fine but for the malicious ones they
0:25:51
know it's not a protected route
0:25:55
which is which is why too i was just
0:25:57
like it would be a lot simpler if you
0:25:59
just threw all of the notes in one
0:26:02
request because then you just ship the
0:26:06
and you just verify that one route
0:26:09
before you update the board and
0:26:12
so um make the back end easier
0:26:20
there's a lightning storm and we just
0:26:24
so how are you still getting the
0:26:25
internet i'm on my laptop oh i'm i'm i'm
0:26:37
i guess the ideal scenario would be
0:26:41
not to send the passcode back but just
0:26:46
the passcode if it's the right one
0:26:49
from the back end as in
0:26:52
not insert it but just
0:26:56
compare and then do
0:26:58
a save if it's the right passcode and if
0:27:01
it's not don't bother
0:27:04
leaving on the back end
0:27:07
yes so you know how we have done the
0:27:10
whole yeah same thing home page one yeah
0:27:23
all right cool so in that case the ball
0:27:27
would come into my court
0:27:31
cool yeah go for it oh you shouldn't do
0:27:37
uh no you can do it man go for it all
0:27:41
you wrote it so you probably know where
0:27:44
better than me where it is too and then
0:27:51
we just have to update those functions
0:27:53
on the front end to send the password
0:27:57
in the body of the request these
0:28:00
patch note and post note
0:28:04
and that would basically happen on the
0:28:12
that would basically happen on the
0:28:15
isn't it yeah yeah yeah this all happens
0:28:24
not really it's not for the show
0:28:27
we're implementing functionality on it
0:28:38
go in and bring my charger because my
0:28:41
battery is dying sure you'll never break
0:28:44
you'll never break us gekko never crack
0:28:53
wow there is a lot of lightning going on
0:29:16
oh unfortunately you can't see any
0:29:26
uh how do i get rid of my background
0:29:41
in the dark coding
0:29:50
all right homies let's do this so i
0:29:54
would open them actually
0:29:57
let me check if i can shave my screen in
0:30:03
uh like i said the lightning is not
0:30:06
behind me it's to my it's to the right
0:30:13
maybe i can maybe i
0:30:16
you would probably have to keep going
0:30:18
because apparently the browser can't
0:30:20
access your screen track wait
0:30:22
really is that like uh is that like a os
0:30:28
is that a mac thing
0:30:31
could that can you see oh no you won't
0:30:34
be able to see it would you
0:30:37
because that position
0:30:39
is that a mac problem
0:30:47
i knew that was coming and i was
0:31:01
you know what it's funny because i was
0:31:03
like finesse why don't you code and then
0:31:05
he had the same problem and i was like
0:31:12
yeah this same thing is it yeah yeah it
0:31:15
must be something with like webkit or
0:31:23
i'm gonna have to have a
0:31:29
no one of those problems then probably
0:31:33
stream yard it's stream yard man
0:31:41
right now you getting your mac then
0:31:44
only if work gives me one
0:31:49
yeah that's the only if they make me use
0:31:51
one i'll use one if i don't got it i'm
0:31:54
not gonna use it i don't care
0:31:56
unless i get some huge advantage by
0:32:02
fast build times like it's so much
0:32:04
faster or something i don't care
0:32:11
heard about the m1 chip is like the
0:32:14
build times are faster
0:32:16
so if you have some build for work it
0:32:22
15 minutes maybe it only takes five
0:32:31
um so where do we need to apply
0:32:34
i don't think when
0:32:37
i don't think we need to apply that
0:32:39
change in the back end to be honest
0:32:43
but we need this we need to add the
0:32:46
we need to decrypt the password right
0:32:50
that's already happening in the back end
0:32:53
but don't we need to do it for each of
0:33:00
so we are just as in comparing this
0:33:03
the string version
0:33:08
version we're not decrypting the
0:33:12
i don't i i'm lost then i don't
0:33:14
understand what we're supposed to do
0:33:22
so um in in the back end there would be
0:33:28
validate credentials or something
0:33:31
something like that
0:33:34
and that what that is doing is basically
0:33:40
taking in the passcode from the front
0:33:42
end as in a string version
0:33:46
comparing it with the hashed version
0:33:51
yep on the database
0:33:53
and if those two match as in the the
0:33:56
string version matches the hashed
0:34:00
it basically returns true
0:34:14
you know what is better
0:34:17
but i didn't know structure um
0:34:21
probably didn't get validate or valid
0:34:24
when it is something validations
0:34:27
oh um it's passcode
0:34:30
and probably go to passcode valid
0:34:50
there's there's a global function well
0:34:52
um probably uh find the word
0:35:14
isn't all we need to do is just grab
0:35:27
what is it called decrypt okay let me
0:35:31
all the instances of this
0:35:40
it doesn't work like that unfortunately
0:35:42
i got to do the find okay
0:35:51
where's the oh you know what um my bad
0:35:54
zayn i don't think i'm on the right
0:35:57
branch or something
0:36:06
am i supposed to be on a different
0:36:18
it would be probably called
0:36:23
oh this is why we need to do
0:36:26
the mergers regularly
0:36:35
hang on a minute i'll just find it
0:37:05
kept functionality
0:37:09
yeah it will be in get board
0:37:10
functionality so let me try that
0:37:18
so if you basically um oh it's called
0:37:26
pin and board name
0:37:36
it's weird why do i not see it
0:37:39
because you're on a different branch the
0:37:42
branch that it's on is get bored
0:37:53
there's a little almost to be happening
0:37:58
that board functionality
0:38:01
huh that doesn't have anything
0:38:19
you're pulling the board passcode
0:38:22
on now it's done i totally told me to
0:38:25
get bored functionality
0:38:28
yeah but um if you go up you pulled a
0:38:39
in the terminal if you go up a bit but i
0:38:46
okay um if you want to
0:38:50
okay but it is up to date like the ui
0:38:54
up here like if there's um
0:39:05
hang on um very far have i even spelled
0:39:11
right then i need to check
0:39:22
did i push it that would be that
0:39:25
question to ask now
0:39:29
i need to have a look at
0:39:35
because if i haven't pushed it i've been
0:39:39
i feel like you have though because
0:39:46
because otherwise it wouldn't
0:39:54
what is go what is wrong then am i do i
0:39:57
have the wrong folder no
0:40:05
we have the correct
0:40:08
file uh tori is this the right project
0:40:18
i should yeah personal their projects
0:40:21
scrum the same apr we have this hashing
0:40:32
let me check if that's even in that
0:40:35
branch because i've got funny feeling
0:40:38
they might not be in this case
0:40:48
verify board name and passcode
0:40:54
no it's in um it's in get board
0:40:59
nothing is merged yet
0:41:04
but it's not in board passcode
0:41:11
it's not in board passcode
0:41:14
no i don't think it's it's involved
0:41:17
unless the branch was done from that
0:41:26
i don't even have the board passcode in
0:41:34
really so on github it's not there
0:41:45
yeah probably oh you got got deployed
0:41:49
to aws but not not committed
0:41:52
is that what you're saying
0:41:57
actually you must be right in that case
0:42:00
because i'm gonna just go and check if
0:42:03
the change of board
0:42:09
fetch plug condition
0:42:14
maybe uh maybe finesse
0:42:20
or somebody just forgot to commit
0:42:24
uh it must have been me
0:42:31
normally worked on back in recently
0:42:37
um this board passcode okay so you said
0:42:40
it's in get bored functionality
0:42:43
this was updated seven days ago
0:42:52
do you wanna ch um do you wanna just
0:42:55
hold on because oh wait
0:42:56
wait wait hold on i found
0:43:05
yeah no it should be verify in and pass
0:43:09
okay yeah here so why is it not on my
0:43:16
and why can i get it
0:43:20
which branches it on get bored
0:43:24
functionality here it is that's weird
0:43:29
no it might you know what it probably
0:43:31
has to do it probably has to do with
0:43:33
when we change to roar coders
0:43:42
it didn't know about upstream or
0:43:44
something i don't know
0:43:47
all right well that makes sense
0:43:50
uh so this is what we need
0:43:54
so this is basically
0:43:56
what is doing is that comparing the
0:44:00
passcode with a hashed passcode in the
0:44:06
and then it's just basically
0:44:15
whole thing to a global
0:44:17
function so we can just reuse it yeah
0:44:24
verify pin and board name
0:44:28
can become a global
0:44:30
thing all right i'll just write it here
0:44:32
and then i'll move it
0:44:41
pin and board name
0:44:56
actually you know what's funny is we
0:44:58
could we could use express middleware to
0:45:16
but yeah like because this is express we
0:45:18
could just use the app dot
0:45:21
use and then just throw this function in
0:45:25
route that we cared about
0:45:29
something to think about um
0:45:35
uh bram so we need this whole thing
0:45:49
we don't want to do the entire post as a
0:45:52
global just a method
0:46:01
or the board too no
0:46:10
you're good you're good i think we need
0:46:12
all of this yeah yeah we need all of
0:46:21
we're gonna take in the
0:46:23
passcode and the board name
0:46:33
all right and then um
0:46:41
don't want to do that
0:46:44
we want to like just
0:46:49
on like or we don't even have to it'll
0:46:51
just be undefined i guess we should we
0:46:56
uh something on the phone
0:46:59
probably not a good practice i don't
0:47:04
do you want to log here
0:47:06
do you want to log there
0:47:30
everything why is okay that's that's my
0:47:42
passcode is already declared in the
0:47:46
oh so these are globals
0:47:51
okay so we don't need them
0:47:57
he has parameters arguments
0:48:04
do well the winter was angry at me
0:48:07
because it said these are already
0:48:27
then all we need to do for this route
0:48:32
is just remove this whole thing
0:48:36
and then we await it
0:48:40
like a pro wait actually i want to save
0:48:57
we're gonna call this here
0:49:04
oh uh looks like we need to
0:49:10
can you help me with the logic here
0:49:13
if uh because we're not returning
0:49:17
i think at the end we want to return
0:49:22
um i thought the results in the try cash
0:49:28
it's only if uh before it would but now
0:49:32
that it's a function
0:49:43
and then await verify
0:49:47
and then board and then this is the
0:49:49
passcode and the board name
0:49:53
and then save the results in the
0:50:08
look at this zoned in
0:50:17
yeah i can hear you
0:50:27
the passcode and the board name
0:50:33
we'll call this result
0:50:41
if not result we're going to spend send
0:50:44
back the error message because that's
0:50:49
result can be false
0:51:01
unexpected spaces after if
0:51:07
no it wants me to add this yes
0:51:18
oh um do you want to return back the
0:51:23
i guess you do all right so we're going
0:51:25
to return there which one
0:51:35
from the result yeah yeah all right so
0:51:49
one second let me see if i can get my
0:51:51
lights back on be right back
0:51:53
yeah think about that
0:52:12
so that would basically become as uh if
0:52:22
sending back the error
0:52:46
i think we'll be having a pretty good
0:52:53
the functionality of the passcode when
0:52:57
the board after getting it so that'll be
0:53:33
all right he is back
0:53:36
hmm looks like i gotta go
0:53:38
and flip the main circuit breaker which
0:53:42
in front of the whole unit and i gotta
0:53:45
see if that does it but
0:53:53
yeah so i think it would just be um
0:54:02
in instead of console logging it just
0:54:17
ah okay um if we can do uh if it comes
0:54:24
then we are returning an error and if
0:54:35
is this is not boolean
0:54:38
oh so this is just true truthy falsey
0:54:49
um type of boolean
0:55:00
oh it's not a type of bullying mm-hmm
0:55:09
yeah and we're going to send that can we
0:55:11
please please send the air back yeah
0:55:19
nice so now we can just reuse this
0:55:32
uh what is it post
0:55:44
so in here we would
0:55:51
add the oh so this is only using
0:55:56
so we don't have a body
0:56:00
so why are we here
0:56:04
i thought you wanted to add the pass
0:56:07
to the post note and
0:56:22
posting and patching the notes we would
0:56:25
do a password verification and if the
0:56:29
password verification comes as true then
0:56:32
we would basically run the
0:56:41
um where are we doing that validation
0:56:44
uh so the validation would happen in the
0:56:50
so there is a method um
0:56:53
that there is a method
0:56:55
called already validates
0:57:00
right right yeah yeah yeah i i'm using
0:57:02
that currently but what i'm saying is
0:57:06
there's end points like say i went to
0:57:11
hit this endpoint save node save nodes
0:57:14
yeah yeah create nodes but there's no
0:57:16
password stopping me from doing that
0:57:26
uh in that case we would have to um
0:57:29
change the logic of all the endpoints
0:57:34
not all of them just the ones you want
0:57:36
to be authenticated
0:57:41
would be authenticated create um
0:57:44
get would be authenticated update will
0:57:49
all of these endpoints aren't touching
0:57:51
the database so anything we want to do
0:57:54
with the database well
0:57:56
in you would need to be authenticated
0:58:00
i thought you only care about the
0:58:02
password when you save the notes
0:58:15
i meant anything we do with the database
0:58:19
we don't want anyone to
0:58:24
do countless requests
0:58:30
the reason why i said save the notes
0:58:34
or get the board they are both
0:58:38
interacting with the database itself
0:58:44
anything that interacts with the
0:58:51
does that make sense or
0:58:53
that i probably haven't explained myself
0:59:07
where it's not public
0:59:16
so the right i would i would say it's
0:59:19
easier if you say which routes you want
0:59:31
saving the notes which is
0:59:37
in patch note routes and
0:59:42
the board is not protected by a password
0:59:48
on the front end to like on the
0:59:51
home.html it helps you to get
0:59:55
a board right yeah yeah
1:00:00
all you have to do then is just add this
1:00:05
password validation to this post a note
1:00:08
and patch a note or
1:00:12
refactor the back end to just include
1:00:16
what i was talking about
1:00:22
post all the notes in one
1:00:26
one request with the passcode
1:00:31
we eliminate a lot of
1:00:34
code and we only have one route and we
1:00:36
only have one request and we only need
1:00:38
to verify the passcode on that one route
1:00:54
um yes it's a bit a bit too much to
1:00:57
think at the moment because my brain is
1:01:01
literally on five percent
1:01:03
um how about if we um discuss about this
1:01:13
um that'd be right
1:01:14
yeah no problem no problem yeah
1:01:20
are we are we all set for tonight then
1:01:26
i'll save this and i don't think we did
1:01:30
anything on the front end
1:01:34
no just some spacing
1:01:46
do you want to do the honors
1:01:49
sure so today we looked
1:01:56
protecting some of the routes and doing
1:02:01
potentially maybe refactoring some of
1:02:05
back end front-end code
1:02:08
because we want to protect
1:02:10
a particular route with a passcode
1:02:13
so we just kind of looked at some of the
1:02:15
existing code we refactored a little bit
1:02:18
to make some code more reusable and then
1:02:22
we're gonna look more in depth in it
1:02:29
yeah and if you wanna see how we do that
1:02:32
feel free to join us tomorrow's same
1:02:41
all right guys have a good night and
1:02:43
thanks for joining
1:02:45
thanks guys have a great night cheers