All language subtitles for 010 Redirecting The User_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
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
ko Korean
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

Now that we saw how we can send a request

with help of the token to a protected resource,

let's come back to the front end

and let's work on the feedback we provide to the user here.

For example, I wanna redirect after we changed the password.

I also want to redirect after we logged in.

And I then also wanna make the log out button

work and so on.

But we'll get there step-by-step.

Let's work on the log in redirection.

In the AuthForm component, I basically wanna redirect here

in this case, that we do have a token

and we do log the user in, in our context API.

Now redirecting is rather straight forward in the end.

I'm using react router here

and we can redirect then in this case by importing

something from react router dom.

And that something which we import here

is the used history hook.

With this hook, we can create a history object

by calling use history.

And we can then use this history object,

here, to call replace,

which redirects the user to a different page

and replace simply means that the user

can't use the back button thereafter to go back

to the previous page.

And here we could redirect the user to the starting page

with just slash for example.

If I do that, you should see that if I now do log in again

with that user, with that new password,

I'm redirected once that succeeded.

So that's rather straightforward.

Now, I also want to redirect after we changed the password.

And of course that works in exactly the same way.

We can go to the profile form

and also import use history here

from react router dom.

And then also create this history object here

by calling use history.

And then once we know that we succeeded here,

we can call history, replace,

and then go somewhere else

for example, again, to the starting page.

Of course here you also don't have

to redirect the user.

It would be fine to stay on this page

and present some success message with you as state

you could manage some states which you then

use to outputs a message if you want to

but here I'll go for the redirect, but that's of course

totally up to you, whether you want to do that.

And if I quickly test this year

by going back to that original password which I used before,

that seems to work.

So that's all working.

Now let's work on the log out functionality.

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