Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Examples of client side auth in react

Are there any examples of client side auth for react? Similar to https://github.com/fnakstad/angular-client-side-auth

If not, what would be a good way to handle role based showing/hiding of specific UI inside react?

like image 782
Eric Avatar asked Dec 23 '14 18:12

Eric


People also ask

How do you use user authentication in React?

There are two main things your React application needs to do to sign on a user: Get an access token from an authentication server. Send the access token to your backend server with each subsequent request.

What is client side authentication?

Client-side authentication is when authentication checks are performed completely at users' side. The idea is that the authentication procedures, methods, or codes are delivered to the client, where they are executed to determine whether a user has access.

Does React uses client side rendering?

By default, your React app will be client-side rendered. This means basically, all of the source code will live in JavaScript files referenced in a single HTML file that initializes your app.


1 Answers

You can read a blogpost I wrote exactly about this subject :). https://auth0.com/blog/2015/04/09/adding-authentication-to-your-react-flux-app/. There's an example on Github linking from the post.

Let me know if you find it useful.

Cheers

like image 114
mgonto Avatar answered Oct 17 '22 19:10

mgonto