All language subtitles for 011 Adding Logout_en

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranรฎ)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

[Maximilian Schwarzmuller} No for logging users out,

we got this log out button here in the main navigation

and at the moment, this button isn't doing anything.

Now, what do we want to do when we click this button?

You might think that we send some requests to Firebase

but keep in mind that the main idea

when using this authentication token approach,

was that the server does not store any information

about the logged in client.

So actually, we don't need to send any requests

because Firebase doesn't know and doesn't care

that we are, or were logged in.

The only thing we need to change when we log out

is our state.

We just have to make sure

that in this context, API, we clear our token.

We set it back to an empty string or to null.

That's the only thing that matters here.

And therefore here in main navigation JS,

we already have access to all the context

we therefore only need to add a number function here,

the log-out handler function, for example

and in that log out handler function,

I'll call off context, log out, which is a function

we already prepared in our context provider.

There in the log out handler, we set the token to null

and that's the handler which we call when we call log out.

And that's the only thing we got to do here.

So, then we just need to bind this log out handler

to this button here with on click and we should be good.

If I save that and I click log out

you see the UI changes once I do log out.

Now, of course we have an issue here though.

If I quickly log back in, if I go to the profile page

and I click log out,

the main navigation changes

but I stay on that profile page.

I'm not redirected away from there.

And that's something we might want to avoid here.

Now, to avoid that,

we can of course also redirect the user here if we want to

but I won't do that here.

And I won't do that here because in the next lecture

I want to dive into another important topic

which will solve this problem for us.

And that will be navigation guards, protecting pages

in our front end react auth.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.