Only Allowing Authenticated Users to Answer a Question

Learn to prevent unauthorized users from answering a question.

Let's focus on the QuestionPage component now and only allow an answer to be submitted if the user is authenticated:

Steps to allow authenticated users to answer a question

  1. We'll start by importing the authentication Hook in @auth0/auth0-react:

Get hands-on with 1400+ tech skills courses.