Skip to content

Commit

Permalink
Merge pull request #28 from juniorbird/error-msg
Browse files Browse the repository at this point in the history
Add user management to set-up workflow
  • Loading branch information
echenley authored Jun 26, 2016
2 parents c3b9660 + cbd000e commit e271f57
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ The test suite is run using `npm test` and `npm run test:watch`. Individual unit
// auth can't be null to make/edit post
// if the post exists, auth.uid must match creatorUID
".write": "(auth != null && !data.exists()) || data.child('creatorUID').val() === auth.uid",

// make sure all 5 fields are present before saving a new post
// leave 'isDeleted' when deleting a post
".validate": "newData.hasChildren(['title', 'url', 'creator', 'creatorUID', 'time']) ||
Expand Down Expand Up @@ -124,12 +124,12 @@ The test suite is run using `npm test` and `npm run test:watch`. Individual unit
"comments": {
".read": true,
".indexOn": ["postId","creatorUID","time"],

"$comment_id": {
".write": "auth != null && (!data.exists() || data.child('creatorUID').val() === auth.uid)",
".validate": "newData.hasChildren(['postId', 'text', 'creator', 'creatorUID', 'time']) &&
(newData.child('text').isString() && newData.child('text').val() != '')",

"upvotes": {
// upvotes must be writable by anyone logged in
".write": "auth != null",
Expand Down Expand Up @@ -169,4 +169,12 @@ The test suite is run using `npm test` and `npm run test:watch`. Individual unit

}
}
```
```

## Firebase Authentication

To set up users, from your Firebase dashboard:

1. Click Auth
1. Click users
1. Enable Email/password sign-in method
1 change: 1 addition & 0 deletions src/js/util/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const errorMessages = {
NO_USERNAME: 'You have to enter a username.',
EMAIL_TAKEN: 'That email is taken.',
USERNAME_TAKEN: 'That username is taken.',
AUTHENTICATION_DISABLED: 'Your administrator needs to configure Firebase authentication',
generic: 'Something went wrong.'
};

Expand Down

0 comments on commit e271f57

Please sign in to comment.