Testing the sign-in and sign-out processes

All of the bits are in place now to give the sign-in and sign-out processes a try. Let's carry out the following steps:

  1. First, we need to create an Auth0 user to sign in with. In Auth0, on the left-hand navigation menu, choose Users & Roles | Users and then click the Create User button. Fill in the form with the user we want to create and click the CREATE button:

  1. Let's make sure both the backend and frontend are running. Then, we can click the Sign In button in the header of the frontend. We are redirected to Auth0 to log in:

  1. After entering the user's credentials, click the LOG IN button. We are then asked to authorize the Q and A app to access the profile and email data: 

This authorization process happens because this is the first login for this user.

  1. After clicking on the tick icon, we will then be successfully logged in and redirected back to our frontend.
  2. Now, let's click the Sign Out button. The browser briefly navigates to Auth0 to log the user out and then redirects to our sign-out callback page:

That completes the sign-in and sign-out process implementations.

At the moment, all of the options in our app are visible regardless of whether the user is authenticated. However, certain options will only function correctly if the user is signed in. For example, if we try submitting a question while not signed in, it will fail. We'll clean this up in the next section.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.224.27.218