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
At the root of your application, wrap your app in an [AuthProvider](https://docs.propelauth.com/reference/frontend-apis/react#auth-provider) component.
The [AuthProvider](https://docs.propelauth.com/reference/frontend-apis/react#auth-provider) is responsible for fetching the current user's authentication information.
59
+
If your entire application requires the user to be logged in (for example, for a dashboard),
60
+
use [RequiredAuthProvider](https://docs.propelauth.com/reference/frontend-apis/react#required-auth-provider) instead and you'll never have to check `isLoggedIn`.
61
+
62
+
## Authorization in the React library
63
+
64
+
On the frontend, authorization is useful for hiding UI elements that the user doesn't have access to.
65
+
You will still need to implement authorization on the backend to prevent users from accessing data they shouldn't.
66
+
67
+
For example, you may want to hide the "Billing" page from users who aren't admins.
68
+
You can do this by using the [UserClass](https://docs.propelauth.com/reference/frontend-apis/react#user-class) to check if the user has the "Admin" role.
0 commit comments