From the course: React: Authentication
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Authentication error handling - React.js Tutorial
From the course: React: Authentication
Authentication error handling
- [Instructor] Okay, the next best practice that we're going to talk about here has to do with handling errors when working with user authentication and authorization in a full stack application. So up until now the way that we've been handling many of our errors has been pretty much just by, well not handling them. In other words, in most places in our application if something goes wrong, we just print the error to the console and this is not necessarily the best thing to do for several reasons. And the main reason, rather obviously, is that this is pretty bad for user experience, although there are other security-related reasons as well that we'll talk about. So, the first best practice, which again is probably pretty obvious, is that if something goes wrong in our application we want to let our users know. If they put in the wrong password when logging in for example, we want to tell them so. And if they try and…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.