On refreshing the page, it is redirecting to the login page. Solutions::: result = await result.json() if(result.error) { alert(result.error) } else { localStorage.setItem('user-info',JSON.stringify(result)) navigate("/add") }
Line 13:6: React Hook useEffect has a missing dependency: 'history'. Either include it or remove the dependency array react-hooks/exhaustive-deps webpack compiled with 1 warning solution this error ??????
All the devs teaching people to use local storage for authentication are doing a serious crime actually. It’s not at all a good practice to do authentication with local storage as the ultimate source of truth, especially user info.
Even on Udemy, folks are teaching to use local storage to check a user authenticity. But, anyone can put a token in local storage and when the page reloads it will find a token and get user logged in. I don’t know why everyone just tells the same way of authentication.
The main reason for not using local storage as for keeping the token is its security, as you may know all the js on the page has access to the local storage, and if one of them is just vulnerable to for example XSS, they can access the local storage, and send it to the attacker. best practices suggest to use cookies for keeping tokens (jwt etc), and the cookie must be set with HttpOnly flag, these kind of cookies are not accessible by the JS on the page, the browser blocks js to access them, and they will be sent to the backend on every http request.
When i put condition on {login} then it shows this :- JSX props should not use functions. So i use function method so what should do and what are the solution for this..!!!
Hey! There is no validation in the frontend! If I hit the LOGIN with empty fields, or with unregistered details, I still can access Add product page etc...You need to check Laravel backend Api response in frontend javascript code!!!!!!!!!!
Is it correct to hit the login request from client side so that password can be seen in api request. Is there some other way for not to expose an login request from client side
@@DesiMatrixXD i am still having doubt that if the user is authenticate successfully, the particular information will be return from database and store inside a local Storage or cookies, but some said these method might introduce Cross-Site attack or forgery, do u have any idea? let say i am implementing the system using flask as api, and react as the frontend and request information one.
btw, i am still new to this area, so basically what u means is storing the token in database and making it expires after a certain period? ps: because there are too many ways to do it.
Really helpful 😃👍🏻
great video thank you
easy to understand..thankyou
This is why simplicity matters
That is a good one.
On refreshing the page, it is redirecting to the login page.
Solutions:::
result = await result.json()
if(result.error)
{
alert(result.error)
}
else
{
localStorage.setItem('user-info',JSON.stringify(result))
navigate("/add")
}
Thank you very much for this video!
cool
Can you make a video on multiple user like admin and user login system with one login form
thanks bro
i will forever love you
very nice tutorial well explained , Sir please give a tutorial on when we hit a url direct it does not work while we go with menu it works.
believe me its very simple way to login.
Line 13:6: React Hook useEffect has a missing dependency: 'history'. Either include it or remove the dependency array react-hooks/exhaustive-deps
webpack compiled with 1 warning
solution this error ??????
Did you find the solution? I am getting the same error.
@@enessenturk8237 useHistory is outdated, look for useNavigate at router documentation
@@xalerion6996 thank you so much.
All the devs teaching people to use local storage for authentication are doing a serious crime actually. It’s not at all a good practice to do authentication with local storage as the ultimate source of truth, especially user info.
Even on Udemy, folks are teaching to use local storage to check a user authenticity. But, anyone can put a token in local storage and when the page reloads it will find a token and get user logged in. I don’t know why everyone just tells the same way of authentication.
@@shashank_rajak do you have a better idea not to store token on local storage, if you have can you share?
The main reason for not using local storage as for keeping the token is its security, as you may know all the js on the page has access to the local storage, and if one of them is just vulnerable to for example XSS, they can access the local storage, and send it to the attacker. best practices suggest to use cookies for keeping tokens (jwt etc), and the cookie must be set with HttpOnly flag, these kind of cookies are not accessible by the JS on the page, the browser blocks js to access them, and they will be sent to the backend on every http request.
Thanks❤
Hi bro, you can put repo? thanks!
When i put condition on {login} then it shows this :- JSX props should not use functions.
So i use function method so what should do and what are the solution for this..!!!
if we are refreshing the page, it is redirecting to the login page again, how to stay on the main dashboard until we press the logout button ?
Good tutorial, honestly had some trouble understanding your speech due to your accent but after a couple of minutes it was alright alright alright :D
Hey! There is no validation in the frontend! If I hit the LOGIN with empty fields, or with unregistered details, I still can access Add product page etc...You need to check Laravel backend Api response in frontend javascript code!!!!!!!!!!
How to prevent CSS & CSRF attacks with react and laravel
Im used this method it shows CORS policy: No Access Control Allow Origin error. How to solve that ...pls help??
Is it correct to hit the login request from client side so that password can be seen in api request. Is there some other way for not to expose an login request from client side
How to Display User detail
and wrong detail Error show..
help me
In html file do i need to specify anything apart from script tag by following URL of js file
How to make signin page and login page work together
need display password or email does not match message or which return api
why didnt u show what's in Header file brother ;(
for me, the login works like a hit or miss. sometimes it works and sometimes it just refreshes the page. Has anyone got a clue what's going on?
maybe you should prevent the default
were is the github repository for the same??
Where is the api code and db ???
Inside description you can see whole playlist... 👍
Hai bro I'm Ganesh How to take Dummy API for Login page AUthentication Purpose
Don't store users info in local storage.
Code pura sir chahiye
How to catch the error in this login
If the user provide wrong password than
Goterror while using await how to solve it Unexpected reserved word 'await'.
the log-in works even when wrong data are passed. it should only allow authenticated users to login
You need to authenticate it in backend. If you want, there are plenty of tutorials available
@@DesiMatrixXD but how to make the server remember every authenticated user?
@@jakjun4077 database
@@DesiMatrixXD i am still having doubt that if the user is authenticate successfully, the particular information will be return from database and store inside a local Storage or cookies, but some said these method might introduce Cross-Site attack or forgery, do u have any idea? let say i am implementing the system using flask as api, and react as the frontend and request information one.
btw, i am still new to this area, so basically what u means is storing the token in database and making it expires after a certain period?
ps: because there are too many ways to do it.
How to restrict back button after login i need to restrict after login cannot be reverse from dashboard to login
I added wrong information it still login
how you have routed the files ?
Hi can share the source code of Reactjs
hi broo I got one error which that Without input also it going to dashboard
what is that "/add" ? is it is component name ?
What is in the header.js file
Hey ,how to hide key and password
useHistory??
Bro react native main bhi signup and login pr video bnayn
right
Let me jump on code....and code is already have useEffect hook . why u take that not explain at all in the video u should have to explaine it
Hi Sir, can u pls provide the link url for this entire project series.. not able to find out
Hi Gopal, did you figure out from where the project was?
can you send me git repository to download
can you provide the source code
sir api kaise create kare
can u send code?
forgot password ka video ayega kya is project mein ??
Can you provide me login back end code
I want only login controller and service
Sir ye Sara chiz Ka shuruaat Kaha se hai... Is wale project Ka ... Please sir bata do
Matlab is video me login samjhaya hai Apne toh shuru Kaha se Kia hai isko... Sign-up aur ye sab Kaha se hai shuru
Where is app.js....not showing app.js ....mental
no God except allah
bro i need code for this video
type it yourself
bhai apna english improve kar, it's too much irritating while u make simple grammatical mistakes in the sentences.