Skip to content

Commit 57034be

Browse files
committed
added README.md
1 parent 36dc805 commit 57034be

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Authentication in React
2+
3+
Handling authentication in React Applications.
4+
5+
## Introduction
6+
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+
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.
10+
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.
12+
13+
## License
14+
15+
Licensed under MIT. Totally free for private or commercial projects.
16+
17+
## Installation
18+
19+
> It is advised that you download this repo as opposed to cloning. This will avoid any accidental project commits to this repository.
20+
21+
## Credits
22+
23+
- [Authentication in React Applications](https://kentcdodds.com/blog/authentication-in-react-applications) by [Kent C. Dodds](https://kentcdodds.com)
24+
- [Modern Sign In Page with Split Screen Format](https://startbootstrap.com/snippets/sign-in-split) by [Start Bootstrap](https://startbootstrap.com)
25+
- Photo by [John Rodenn Castillo](https://unsplash.com/@nightcrawler1986?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/s/photos/blue?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyTex)

0 commit comments

Comments
 (0)