Open aleshakay opened 4 years ago
import firebase from 'firebase/app';
import 'firebase/auth';
import './Auth.scss';
class Auth extends React.Component {
loginClickEvent = (e) => {
e.preventDefault();
const provider = new firebase.auth.GoogleAuthProvider();
firebase.auth().signInWithPopup(provider);
}
render() {
return (
<div className="Auth">
<h1>Auth Page</h1>
<button className="btn button-big" onClick={this.loginClickEvent}>Login with Google</button>
</div>
);
}
}
export default Auth;```
UserStory
As a user, I need to have the ability to authenticate into the website.
AC
WHEN THEN
DevNotes
App.js, Auth.js, authData.js, connection.js
const firebaseApp = () => { if (!firebase.apps.length) { firebase.initializeApp(firebaseConfig.firebaseKeys); } };
export default firebaseApp;```
const getUid = () => firebase.auth().currentUser.uid;
export default { getUid };