{"id":20115540,"url":"https://github.com/mutualmobile/reactfirebaseauthcomponent","last_synced_at":"2025-03-02T19:19:20.058Z","repository":{"id":137248796,"uuid":"92544460","full_name":"mutualmobile/ReactFirebaseAuthComponent","owner":"mutualmobile","description":"Reusable code for simple authentication and integration with Firebase","archived":false,"fork":false,"pushed_at":"2017-06-08T17:06:14.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-01-13T06:26:33.027Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mutualmobile.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-26T20:01:02.000Z","updated_at":"2017-05-26T23:50:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"9572f56d-6a66-40c2-9ea1-d7ea4e45ba23","html_url":"https://github.com/mutualmobile/ReactFirebaseAuthComponent","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutualmobile%2FReactFirebaseAuthComponent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutualmobile%2FReactFirebaseAuthComponent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutualmobile%2FReactFirebaseAuthComponent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutualmobile%2FReactFirebaseAuthComponent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mutualmobile","download_url":"https://codeload.github.com/mutualmobile/ReactFirebaseAuthComponent/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241557463,"owners_count":19981919,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T18:35:36.007Z","updated_at":"2025-03-02T19:19:20.031Z","avatar_url":"https://github.com/mutualmobile.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React-Firebase-Mobx-Auth\n\n### This mobx store handles authentication with firebase\n\n\n### Setup\n\nIn your main app entry point (app.js) use the mobx-react Provider to pass this auth store down the component tree\n\n``` javascript\nimport React, { Component } from 'react';\nimport {Scene, Router} from 'react-native-router-flux';\nimport {AppRegistry} from 'react-native';\nimport {Provider} from 'mobx-react';\nimport Routes from './Routes';\nimport Auth from './stores/Auth';\n\nclass App extends React.Component {\n  render() {\n    return \u003cProvider authorization={Auth}\u003e\n      \u003cRoutes /\u003e\n    \u003c/Provider\u003e\n  }\n}\nAppRegistry.registerComponent('App', () =\u003e App);\nmodule.exports = App;\n```\n\n\nIn your router you will want to define your firebase library, a success, and failure function.\n\n``` javascript\nimport React, { Component } from 'react';\nimport {Scene, Router, Actions} from 'react-native-router-flux';\nimport { AppRegistry } from 'react-native';\nimport Login from './components/views/Login';\nimport Register from './components/views/Register';\nimport Home from './components/views/Home';\nimport {observer} from \"mobx-react\";\nimport RNFirebase from './modules/RNFirebase';\n\n@observer(['authorization'])\nclass Routes extends React.Component {\n  componentDidMount() {\n    this.props.authorization.bindAuthHandler(\n        RNFirebase,\n        user =\u003e{\n          // successful authentication \n          \n          this.props.authorization.saveUser(user);\n          this.props.authorization.setFcmToken(user);\n          Actions.home()\n        },\n        ()=\u003e{\n          // failed authentication\n          Actions.login()\n        }\n        );\n  }\n  render() {\n    return \u003cRouter\u003e\n      \u003cScene key=\"root\"\u003e\n        \u003cScene key=\"login\" component={Login} title=\"Login\" initial={true}/\u003e\n        \u003cScene key=\"register\" component={Register} title=\"Register\"/\u003e\n        \u003cScene key=\"home\" component={Home}/\u003e\n      \u003c/Scene\u003e\n    \u003c/Router\u003e\n  }\n}\nAppRegistry.registerComponent('Routes', () =\u003e Routes);\nmodule.exports = Routes;\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmutualmobile%2Freactfirebaseauthcomponent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmutualmobile%2Freactfirebaseauthcomponent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmutualmobile%2Freactfirebaseauthcomponent/lists"}