0:00:24
welcome back guys to another episode of
0:00:27
buildbreaking fakes brought to you by
0:00:33
today we have finesse and i how you
0:00:35
feeling today flash
0:00:38
hey zayn thanks for the introduction um
0:00:40
yeah feeling really good
0:00:43
um yeah i got my background today
0:00:47
loving it yeah loving it
0:00:49
yeah it looks pretty cool though
0:00:56
work on the alignment but yeah
0:01:00
yeah yeah i mean um
0:01:02
that can always be fixed but the best
0:01:05
part is that you have
0:01:09
on and um yeah i guess the
0:01:16
which one are you and which one is me
0:01:21
you're probably gonna be there one on
0:01:24
right okay oh yeah
0:01:27
you're gonna be as in
0:01:30
be hands-on and i will be as in on the
0:01:37
giving you a thumbs up on every
0:01:40
line of code you're right
0:01:45
fantastic all right so before further
0:01:47
ado let's um acknowledge that the
0:01:51
country and the past
0:01:53
and the elders of the past president
0:01:58
i begin today by acknowledging the
0:02:00
traditional custodians of the land on
0:02:03
which we gather today and pay my
0:02:05
respects to the elders past present and
0:02:08
i extend their respect to aboriginal and
0:02:11
torres strait islander people here today
0:02:18
jacob is here so hey geezers
0:02:30
so he is kind of recovering as we
0:02:33
speak hopefully he will be
0:02:38
tomorrow if he's feeling better and
0:02:41
well enough to show off his
0:02:46
skills and his adorable face
0:02:54
do you want to share screen today flash
0:02:57
yeah yep can do just thinking about um
0:03:02
in terms of so we were up to the fact
0:03:06
that we wanted to um
0:03:10
we wanted to make sure that when we
0:03:21
as in board names already doing but the
0:03:24
associated um passcode as well
0:03:31
okay i remember so which means that the
0:03:34
array how is storing at the moment
0:03:36
though that would probably have to
0:03:40
instead of just strings it would
0:03:43
have to be objects
0:03:49
i will so frontend code
0:03:54
yeah frontend code
0:04:24
we didn't choose the music
0:04:26
oh i totally forgot i totally forgot
0:04:31
all right so today would be
0:04:36
let's ask jack dev if you want to choose
0:04:44
okay deb if you're up
0:04:47
do you want to choose a letter
0:05:05
don't think he's um on his desk at the
0:05:14
we can ask him probably i
0:05:17
it can be his turn tomorrow as well
0:05:21
all right so do you wanna ashley's my
0:05:33
do you want to do the counter
0:05:41
you okay let's see
0:06:05
how did you find it
0:06:06
yeah yeah that's good
0:06:11
okay character just let up and fit light
0:06:31
do you wanna maybe zoom in a bit because
0:06:34
i'm finding it hard to kind of
0:06:37
see this yeah that's
0:06:40
yeah that's much better
0:06:43
i'm just trying to find the
0:06:47
branch thing is it
0:06:51
get bored functionality
0:06:53
get both functional okay
0:07:46
drive it for a bit
0:07:56
so i think it was still front end
0:08:09
yep that's the one
0:08:13
so we basically have to
0:08:21
um we basically have to go into get
0:08:23
board names on line 26
0:08:32
you know where the
0:08:36
and then we are storing all the
0:08:40
names in the board's
0:08:42
name from the board's object
0:08:45
yeah maybe we would need to
0:08:52
the passcode in the board border board
0:09:10
let me have a look and have a look at
0:09:13
board object is returning
0:09:24
i think he should be returning passcode
0:09:28
it would be good luxem right yeah yeah
0:09:33
it's good to confirm always
0:10:01
i don't know why whenever i see the
0:10:06
i have to really i feel really proud of
0:10:12
yeah this could happen
0:10:19
yeah yeah so we have the passcode as
0:10:25
and that's in the board object isn't it
0:10:30
okay so now what we basically have to do
0:10:46
both of them the uh the board passcode
0:10:57
um so if you want to put a comma
0:11:03
that's what we tried last time right
0:11:06
did you not come oh and we tried it but
0:11:09
before implementing it
0:11:16
as far as i can remember
0:11:23
let's just have a look anyways
0:11:27
yeah it doesn't cost
0:11:52
yeah so it's just got the
0:11:55
just the board names i can hardly see
0:11:57
that okay so sorry
0:11:59
just the board and names is it okay
0:12:03
uh yes so here are because it's mapping
0:12:11
chessboard have the board
0:12:18
why does the first one come in an array
0:12:21
and the rest of them are strings in the
0:12:27
oh this one is just that's what it's
0:12:29
returning and i've just opened it like
0:12:31
okay cool right right i see yeah cool
0:12:35
okay um so if you go back
0:12:39
because we are already getting the
0:12:44
board as in the pass code and everything
0:12:47
in the board's object
0:12:50
how's it going yes it's doing
0:12:58
we need like um key value pass or
0:13:01
oh yeah it was like
0:13:05
tuples inside the array maybe
0:13:19
we don't even we don't necessarily need
0:13:23
the board's name array anymore
0:13:30
the board object the board's object it's
0:13:39
the board name and the associated
0:13:41
passcode as object
0:13:44
in it of each board
0:13:47
isn't it so what we can basically do is
0:13:50
put all the objects into the array
0:13:54
and then push them in the right cell
0:14:02
yeah that makes sense i'm just thinking
0:14:07
do the checking here then
0:14:11
basically that functionality would need
0:14:14
be changed as well now
0:14:18
we're doing the check on the board name
0:14:26
for the strings you
0:14:29
if the board name matches
0:14:33
in the object then make sure make sure
0:14:37
that that the passcode is in there as
0:14:41
as in for this associated board
0:14:47
yes yes i understand
0:14:53
at time so if you go back to
0:14:56
get bored names where we
0:14:59
saw the boys objects hey tori oh come on
0:15:02
good to have you again yeah later
0:15:06
first this is some water in our gullets
0:15:15
you know where you have
0:15:27
do another right yeah
0:15:32
no okay get rid of this
0:15:34
yeah maybe get rid of the entire line
0:15:38
except but um so entitled um all right i
0:15:43
just i should probably speak a bit
0:15:51
get rid of the part of the equals
0:16:11
and then probably come
0:16:13
and then remove the equal
0:16:20
no no sorry my will we have time yes
0:16:25
screaming at us why have you not
0:16:27
declared it you idiot
0:16:35
yeah so probably do equals and then
0:16:46
and then board object
0:16:52
do a for loop here
0:16:59
jack that was gonna go
0:17:02
we're gonna have something really
0:17:04
interesting to say i have a feeling
0:17:09
or maybe not maybe no we can basically
0:17:16
we can still use a map hang on i'm gonna
0:17:22
i forgot how a map you used to work
0:17:57
we need to put it in an internet array
0:18:05
for the boards i'm gonna come as objects
0:18:17
what does it look like now again let me
0:18:19
just have another book
0:18:24
unless they're already coming in there
0:18:27
i feel like i don't need to do that
0:18:37
are they coming already in the array
0:18:48
can you expand one of them
0:18:51
yeah okay cool we don't need it it's
0:18:53
already doing all right it's already
0:18:56
done the work for us cool
0:19:01
we don't need board names array anymore
0:19:07
let's get rid of it
0:19:09
yeah yeah but make sure um
0:19:12
whatever is referenced
0:19:16
make sure that we are using it properly
0:19:26
this isn't gonna change sorry existing
0:19:32
right um do you wanna control find
0:19:36
wherever the board names array has been
0:19:49
i think it was just
0:19:53
because the top one we were
0:19:56
we changed yep so ah all right so
0:20:00
that's getting the board's name isn't it
0:20:05
which is technically boards
0:20:08
get bored password um
0:20:10
get boom names and passcodes
0:20:16
so which means that board names should
0:20:24
yes yeah yeah anyway
0:20:35
do you want to maybe console the log
0:20:37
board names i didn't want to make sure
0:20:40
that is coming up as an
0:20:54
we can change the theme right
0:21:12
i think because we need to
0:21:25
items yeah okay cool so it is coming up
0:21:29
all right so now basically what we need
0:21:32
to do is if we go back in the code so we
0:21:35
have got an array of objects
0:21:39
so if what does include do
0:21:46
includes this string
0:21:55
we'll check the list of
0:22:04
if you want to do this as board names
0:22:14
if the board names
0:22:18
includes that string
0:22:20
we'll probably have to keep that as um
0:22:36
probably the naive way would just be
0:22:43
i was to be honest i was gonna suggest
0:22:46
that but then we were gonna get another
0:22:49
lull from get there
0:23:01
in the array of objects hang on
0:23:47
we will probably have to use the arrays
0:23:56
we will probably have to use the method
0:24:02
compare so what it does is that this
0:24:04
this method which is is array
0:24:08
open brackets in close brackets it
0:24:12
whether an object or variable is in the
0:24:18
is exactly what we want
0:24:24
board names is an array so if we use
0:25:03
enter a board name and then
0:25:11
let's just check something
0:25:14
the thing with this one is um
0:25:20
i have to check um
0:25:26
is equal to the one that's in the
0:25:34
um i'm kind of taking really baby steps
0:25:48
maybe do you want to open up this
0:25:56
go through it on the
0:26:00
on the stream itself
0:26:09
so say for example our board
0:26:26
v1 is created some variables is array
0:26:31
so type of is returns object to object
0:26:39
and then testing if the variable is in
0:26:44
so it's testing if the object's
0:26:56
comparing objects with the
0:27:00
oh okay yes yes i understand you know
0:27:04
what we could do then saying this would
0:27:05
be pretty straightforward i think this
0:27:10
the board name in the passcode then put
0:27:13
this into an object and then
0:27:17
and then just test it against the
0:27:19
just put it in here to test it against
0:27:21
the array that way we don't yeah we just
0:27:29
hold on let's do that
0:27:38
i just just wanted to check this yeah
0:27:50
i think this this just just checking
0:27:54
oh this is just checking whether it's an
0:28:01
since this is an object it's false and
0:28:03
then since this isn't the range
0:28:07
you're right you're right
0:28:12
checks if it's an array or not that's
0:28:31
checking whether an object is in an
0:28:33
array if an array contains an object
0:28:39
oh um the first link
0:28:49
okay so they're all missing
0:28:54
can you see the screen yes i can
0:29:15
and then comparing the each
0:29:22
we could potentially do this
0:29:26
oh yeah yeah yeah we could do this
0:29:41
element dot board name
0:29:43
equals our board name and and window
0:29:47
passcode equals our password then return
0:30:02
streaming uh as in having a consistent
0:30:07
thing is really kind of it's really kind
0:30:13
honing our technical skills isn't it
0:30:16
yeah for sure man yeah no
0:30:20
doubt get this is done ship it
0:30:25
right that would be
0:30:27
i know i'm not going to say i'm not
0:30:29
going to say anything
0:30:30
i'm going to get something back i know
0:30:33
for sure so i'm not going to bother
0:30:41
i'm just gonna comment this stuff
0:30:54
um maybe create a function instead
0:30:58
and and then just call the function here
0:31:04
yeah yeah i can do
0:31:07
should we try it first and then maybe
0:31:15
i'm just gonna copy it like as it is and
0:31:18
then we can refactor it after
0:31:24
oh our toys asking are all
0:31:28
are the passwords all on the fountain on
0:31:30
this mr oh um we implemented um the past
0:31:35
code part theory in the back end and um
0:31:41
now what we're doing is just basically
0:31:45
calling you from them from the back end
0:32:02
did that answer your question
0:32:32
i just want to check the exact name
0:33:21
oh but because we're using this ah yeah
0:33:26
i didn't see that problem my bad
0:33:32
okay so we actually need to
0:33:41
yes so that would basically
0:33:50
all we shouldn't do the apparent
0:33:57
or we don't have to do the description
0:34:01
because it's already the password is
0:34:12
on creation it includes the password so
0:34:16
why not we include the password here as
0:34:21
and then and then just
0:34:24
i think there's a compare method with
0:34:28
b grip so maybe we can use that
0:34:33
so you want to dig
0:34:36
oh yeah the compare method was it as
0:34:43
definitely choose that
0:34:44
why are you choosing some instead of
0:34:48
because someone if some was in that blog
0:34:54
we should probably see what fine does
0:34:57
and then choose find
0:35:01
let's check if an already contains an
0:35:07
are they having to find there
0:35:12
i was blind didn't get there from my bed
0:35:15
no you had to scroll down a little bit
0:35:19
cool yeah then let's just
0:35:23
but what's the difference between
0:35:25
some and fine just curious
0:35:31
i'm going to google this
0:35:34
give me one second i'm just going to
0:35:48
it says that you're looking for one
0:35:50
particular array item and someone or you
0:35:52
are clearly checking forever
0:35:59
fine method states that you're looking
0:36:02
for one particular array item yeah which
0:36:05
is right we want that
0:36:09
you're clearly checking
0:36:12
if the array contains items defeat yeah
0:36:16
i see i think that would make sense
0:36:29
it it checks that if
0:36:32
one particular item
0:36:34
or an object is present in the array
0:36:41
checks for more than one as in if
0:36:44
okay those items are present
0:36:49
let's see okay yeah
0:36:54
uh on to using javascript and working
0:37:04
javascript at the moment
0:37:07
that's what i'm primarily working with
0:37:42
reload hash from the
0:37:53
this would be our password
0:38:04
load hash from your password
0:38:10
loading the hash is not decrypting or
0:38:15
remember from the front end our password
0:38:18
is coming as a string
0:38:23
one two three four as string
0:38:51
see if we're getting the hash here
0:38:58
no but that's coming from the
0:39:00
database remember that when we press
0:39:07
as in all the board names and passcodes
0:39:13
populated in the background
0:39:16
so we can compare our board
0:39:19
name as a string and the passcode that
0:39:22
we've just entered with that array if
0:39:25
it's present or not
0:39:30
but how can we compare the screen
0:39:34
that's what we're trying to do at the
0:39:38
so what we need uh the comparison
0:39:44
am i getting something wrong oh
0:39:46
we're missing something
0:39:52
if you go back to the
0:39:58
in that one it says to check a password
0:40:08
which means that it loads the hash from
0:40:13
but we are already doing it in our way
0:40:17
we're all we're already loading the
0:40:22
and the board names
0:40:25
from the backhand yeah yeah i understand
0:40:28
what you're saying i think
0:40:29
i think the comment
0:40:31
is confusing because i think what they
0:40:35
the hash is loaded from the db
0:40:38
in the in this case like yeah this
0:40:42
is one that is loaded from the db that's
0:40:48
and that would pretty much be
0:40:50
correct according to what i'm
0:41:00
see how you've got okay how about if we
0:41:03
check what exactly does the compare
0:41:16
just probably do a
0:41:18
control find and doing that way will be
0:41:26
compare okay so call back
0:41:29
so it takes data to compare
0:41:35
so the first argument
0:41:38
is data to compare
0:41:40
which is our passcode coming from the
0:41:44
that we have just entered
0:41:52
would be from the database
0:41:55
which is loaded for us
0:41:58
for us as a passcode
0:42:03
for the compare method to word uh
0:42:07
to work for from what i'm understanding
0:42:09
at the moment is that both the arguments
0:42:12
have to be in hash
0:42:28
goldberg you wanted to as in
0:42:32
like um clarify my thing
0:42:36
you don't don't know what the sink is
0:42:37
but if you see this one
0:42:43
the avenues hash yet and then they've
0:42:48
is this a different method that we were
0:42:51
looking from before
0:42:54
yes it is the other one we were looking
0:42:58
i don't know i don't know which one we
0:43:00
have to use actually but the other one
0:43:01
we're looking at this year
0:43:08
yeah because from my understanding what
0:43:11
we're trying to do
0:43:13
this one as in just to compare itself
0:43:16
might not work and
0:43:18
the reason why it might not work is
0:43:25
actually i might be wrong
0:43:28
and you may be right
0:43:33
try this because i didn't see the first
0:43:36
uh i only listened to the
0:43:39
first word the first
0:43:43
which is using the hash code and
0:43:47
comparing it with the hash but i'm just
0:43:50
now seeing the second one where it's
0:43:53
actually comparing the actual
0:43:58
to the hash so yeah
0:44:16
yeah that's right tori
0:44:22
if you want to use b crypt here we
0:44:26
declare it up here
0:44:39
we will probably have to install it
0:44:42
and then by npm install and then do that
0:44:51
um is that the right
0:45:02
um yeah that should be right i think so
0:45:25
added two packages okay
0:45:29
big crypts and now we can use it in
0:45:36
import the if statement
0:45:50
bordeaux passcodes sorry my bad
0:45:54
and then yeah okay
0:45:56
you're right you're right
0:46:10
and then if these both are true only
0:46:27
okay so it's found is there and now if
0:46:37
if it's found then open
0:46:40
alerts what is that let's say
0:46:50
i think open english shouldn't be there
0:46:56
can't find a can it
0:47:07
to see on the opening
0:47:11
uh okay because in my uh there
0:47:15
it must be in another javascript file
0:47:17
and that's being imported
0:47:26
okay so what does it say
0:47:34
actually you know what don't worry about
0:47:39
let's test it because i wanna just see
0:47:44
says and if it's appropriate to us
0:48:11
a ripe a right board but the wrong
0:48:17
right board but wrong patch this board
0:48:25
because the alert will only come up if
0:48:28
it's called either of them are wrong
0:48:31
so the ball don't match
0:48:36
one core reference requires not defined
0:48:51
the require is not defined
0:48:58
is a keyword and that's
0:49:01
defined apparently this one
0:49:06
can we make sure we use either const or
0:49:10
okay instead of uh
0:49:21
why did you say it's not defined
0:49:27
file is accomplished we maybe can to any
0:49:42
but how are you gonna import it
0:49:51
how will we import the
0:49:55
decryption if you don't need it
0:50:22
i think you will be const or let and
0:50:26
then the variable and then import that
0:50:32
required we use import apparently
0:51:01
import big crypts from b crypt
0:51:15
and the end uh the
0:51:20
is as a single quote
0:51:28
there's a single quote
0:52:08
use input outside cannot use input 7
0:52:31
yeah it is as there
0:52:33
or maybe put the uh put the first big
0:53:04
you need to use their script and add it
0:53:23
what are you thinking
0:53:25
what should we try
0:53:29
what we applied i just want to check if
0:53:34
do you mean the the curly brackets yeah
0:53:41
he said the same thing
0:53:44
okay in that case maybe just to um the
0:55:29
so apparently we can just use it as a
0:56:20
oh so it says that
0:56:22
um if you're really required to use
0:56:24
bigquery client-side use a static
0:56:28
salt static salt okay
0:57:19
what we thinking finish
0:57:22
how do we how do we go about that
0:57:29
oh that's what i was researching
0:58:22
keep this one for tori tomorrow
0:58:30
he's our front end genius
0:58:38
what did he say in the comments your
0:58:39
daughter is not secure and they are
0:58:44
see that's a powerful word whenever
0:58:48
lord it can mean different things
0:58:51
depending on the context
0:59:05
anything that you want to add
0:59:21
um should i do the closing
0:59:26
um so in today's episode
0:59:38
checking in the front end uh passcode
0:59:40
and board name check in the front end
0:59:42
pretty close i think we use the find
0:59:46
yeah getting really close but we're
0:59:47
going to leave the the tricky part
0:59:49
tutorial tomorrow so if you're keen to
0:59:52
to uh to catch us on that episode join
0:59:55
us tomorrow same time
1:00:05
all right guys have a good night