reactjs - React/Rebase/Firebase warning: Permission Denied - How do I add user authentication? -
please excuse simplicity of question can't rebase/firebase work due permission errors (rebase similar firebase https://github.com/tylermcginnis/re-base)
i building simple website part of react.js tutorial , want persist state on page. this, want firebase database, without user authentication, when set database, permission errors user authentication must mandatory.
this have @ top of main.js:
var rebase = require('re-base'); var base = rebase.createclass('https://fishmonger-f3761.firebaseio.com/');
and in main app component, added this:
componentdidmount : function() { base.syncstate(this.props.params.storeid + '/fishes', { context : this, state : 'fishes' });
i following warning in console:
firebase warning: set @ /(*my custom store name*)/fishes/fish1/name failed: permission_denied
how add in anonymous browser-session based user authentication disregard error?
firebase db default rules require authentication.
from get started database rules page:
by default, database rules require firebase authentication , grant full read , write permissions authenticated users. default rules ensure database isn't accessible before chance configure it.
that means that, instance, can give access anyone. need change default rules of database (again same documentation page):
// these rules give anyone, people not users of app, // read , write access database { "rules": { ".read": true, ".write": true } }
read other samples on page linked find 1 suit needs.
edit
to access rules go console (make sure you're logged in google) , select "database" in sidebar menu, click on "rules" tab. url should https://console.firebase.google.com/project/<your-project>/database/rules
Comments
Post a Comment