This video is available to students only

Authentication context

Project Source Code

Get the project source code below, and follow along with the lesson material.

Download Project Source Code

To set up the project on your local machine, please follow the directions provided in the README.md file. If you run into any issues with running the project source code, then feel free to reach out to the author in the course's Discord channel.

Previous LessonAuth flow linkNext LessonGraphQL queries - getting the user data

Lesson Transcript

  • [00:00 - 00:53] Authentication context inside of the SRC auth create new file client provider. tsx here expert the client provider expert const client provider is going to receive children so we can specify the props children as props with children from empty object here defining the client const client new Apollo client will need to pass an options object cache is going to be in memory new in memory cache we're not going to preserve it anywhere else and the link is the auth flow link that we defined in the previous lesson auth flow link return Apollo provider with client client and render the children inside of it now wrap our application into the Apollo provider open index and wrap the app into client provider now make sure that you can still run the app run yarn start and the app should launch successfully

This lesson preview is part of the Fullstack React with TypeScript Masterclass course and can be unlocked immediately with a \newline Pro subscription or a single-time purchase. Already have access to this course? Log in here.

Unlock This Course

Get unlimited access to Fullstack React with TypeScript Masterclass, plus 70+ \newline books, guides and courses with the \newline Pro subscription.

Thumbnail for the \newline course Fullstack React with TypeScript Masterclass