as a devloper, i need a way to authorize my users so that they can use the website
AC
WHEN a users first loads the site
THEN they should only a basic site
AND they should not be able to do anything except log in
AND when they click the log in button they will sign in with google
AND once signed in the user will have full reign of the site
DEV NOTES
In App.js
import firebase from 'firebase/app' and import 'firebase/auth' in App.js
create a PiblicRoute and a PrivateRoute (see more in comments below)
set state
create a componentDidMount that removesListner for firebase.auth().onAuthStateChange
this should be an if statement that changes the auth state from true to false.
make a componentWillUnmount that calls removeListener
create a file named connection.js in this directory ../helpers/data/
in this file create a function that connects your authorized users to firebase
USER STORY
as a devloper, i need a way to authorize my users so that they can use the website
AC
WHEN a users first loads the site THEN they should only a basic site AND they should not be able to do anything except log in AND when they click the log in button they will sign in with google AND once signed in the user will have full reign of the site
DEV NOTES
App.js
firebase from 'firebase/app'
and import'firebase/auth'
inApp.js
PiblicRoute
and aPrivateRoute
(see more in comments below)state
componentDidMount
that removesListner forfirebase.auth().onAuthStateChange
auth state
from true to false.componentWillUnmount
that callsremoveListener
connection.js
in this directory../helpers/data/
const firebaseApp = () => { if (!firebase.apps.length) { firebase.initializeApp(firebaseConfig.firebaseKeys); } };
Auth.js
../components/shared/
calledAuth
js
andscss
file'firebase/app'
loginClickEvent
MyNavbar
state
toisOpen: false,
logMeOut
toggle
that will swap the stateisOpen: false
toisOpen: !this.state.isOpen
render()
create a var for{ isOpen }
and set it tothis.state;