You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@
6
6
7
7
This proof-of-concept has been heavily inspired by a [blog post](https://kentcdodds.com/blog/authentication-in-react-applications) I read by Kent C. Dodds (which I encourage you to go and read also). What this application does is checks to see if the current user is authenticated. If they are not, then they are restricted access to routes specifically for authenticated users.
8
8
9
-
I have achieved this by wrapped the `<App />` component in a couple of providers. Firstly the `<AuthProvider />` is responsible for bootstrapping the app data. Then secondly the `<UserProvider />` is responsible for keeping the user data up to date in memory.
9
+
I have achieved this by wrapping the `<App />` component in a couple of react providers. Firstly the `<AuthProvider />` is responsible for bootstrapping the app data. Then secondly the `<UserProvider />` is responsible for keeping the user data up to date in memory.
10
10
11
11
The `<App/ >` component will render the `<UnauthenticatedApp />` component until the current users data is retrieved. Once that data has been fulfilled it is determined that the user is logged in and the `<AuthenticatedApp />` component will be rendered instead. It will be literally impossible to render one side of the app or the other if there is no user.
0 commit comments