https://github.com/solidstategroup/simple-firebase-auth
Simplified Firebase authentication for web with support for Facebook & Google login
https://github.com/solidstategroup/simple-firebase-auth
Last synced: 11 months ago
JSON representation
Simplified Firebase authentication for web with support for Facebook & Google login
- Host: GitHub
- URL: https://github.com/solidstategroup/simple-firebase-auth
- Owner: SolidStateGroup
- Created: 2016-10-06T14:02:02.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-21T09:20:42.000Z (almost 9 years ago)
- Last Synced: 2025-04-13T14:54:12.912Z (11 months ago)
- Language: JavaScript
- Homepage:
- Size: 121 KB
- Stars: 7
- Watchers: 7
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
# Simple Firebase Auth
[](https://gitter.im/SolidStateGroup/simple-firebase-auth?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
**For react-native check out https://github.com/SolidStateGroup/react-native-firebase-auth**
Simplified Firebase authentication for web with support for Facebook & Google login.
Using this module alongside Firebase means there is no need to write and host any backend code to handle users logging in to your app.
Use our project starter repository (https://github.com/SolidStateGroup/firebase-project-starter) to help you get started setting up your own Firebase project.
## Install
```
$ npm install --save firebase simple-firebase-auth
```
## Project Setup
You will need to initialise Firebase within your app in the usual way. See https://firebase.google.com/docs/web/setup
## Example Usage (with React)
```
import FireAuth from 'simple-firebase-auth';
constructor(props) {
super(props);
FireAuth.init({
fbAppId: "",
webClientId: "",
apiKey: ""
});
}
componentDidMount() {
FireAuth.setup(this.onLogin, this.onUserChange, this.onLogout, this.emailVerified, this.onError);
}
register = () => {
const { email, password, firstName, lastName } = this.state;
FireAuth.register(email, password, { firstName, lastName });
}
login = () => {
FireAuth.login(this.state.email, this.state.password);
}
facebookLogin() {
FireAuth.facebookLogin();
}
googleLogin() {
FireAuth.googleLogin();
}
logout() {
FireAuth.logout();
}
update () => {
FireAuth.update({
firstName: this.state.firstName,
lastName: this.state.lastName
}).then(() => {
...
}).catch(err => {
...
});
}
resetPassword () => {
FireAuth.resetPassword(this.state.email)
.then(() => {
...
})
.catch(err => {
...
});
}
updatePassword () => {
FireAuth.updatePassword(this.state.password)
.then(() => {
...
})
.catch(err => {
...
});
}
```
# Getting Help
If you encounter a bug or feature request we would like to hear about it. Before you submit an issue please search existing issues in order to prevent duplicates.
# Contributing
For more information about contributing PRs, please see our Contribution Guidelines.
# Get in touch
If you have any questions about our projects you can email projects@solidstategroup.com.