You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat(reducers): `authError` reducer added to mirror authError state in v1 - #237
* fix(populate): Update to deep path roots do not work with population - #241
* fix(auth docs): Login method docs for authWithCustomToken updated - #245
Copy file name to clipboardExpand all lines: docs/api/reducer.md
+14Lines changed: 14 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,7 @@
7
7
-[requestedReducer](#requestedreducer)
8
8
-[timestampsReducer](#timestampsreducer)
9
9
-[authReducer](#authreducer)
10
+
-[authErrorReducer](#autherrorreducer)
10
11
-[profileReducer](#profilereducer)
11
12
-[errorsReducer](#errorsreducer)
12
13
-[listenersReducer](#listenersreducer)
@@ -78,6 +79,19 @@ Reducer for auth state. Changed by `LOGIN`, `LOGOUT`, and `LOGIN_ERROR` actions.
78
79
79
80
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Profile state after reduction
80
81
82
+
## authErrorReducer
83
+
84
+
Reducer for authError state. Changed by `LOGIN`, `LOGOUT`, `LOGIN_ERROR`, and
85
+
`UNAUTHORIZED_ERROR` actions.
86
+
87
+
**Parameters**
88
+
89
+
-`state`**[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Current authError redux state (optional, default `{}`)
90
+
-`action`**[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object containing the action that was dispatched
91
+
-`action.type`**[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Type of action that was dispatched
92
+
93
+
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** authError state after reduction
94
+
81
95
## profileReducer
82
96
83
97
Reducer for profile state. Changed by `SET_PROFILE`, `LOGOUT`, and
*[**String**](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) - `ref.authWithCustomToken(credentials)` is used
[**Promise**](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) with an object containing profile, user, (also credential if using oAuth provider) in case of success or the error otherwise.
85
+
[**Promise**][promise-url]with an object containing profile, user, (also credential if using oAuth provider) in case of success or the error otherwise.
*`credentials.signIn` [**String**](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) - Whether or not to sign in when user is signing up (defaults to `true`)
[**Promise**](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) with `userData`
150
+
[**Promise**][promise-url] with `userData`
152
151
153
152
## logout()
154
153
Logout from Firebase and delete all data from the store (`state.firebase.data` and `state.firebase.auth` are set to `null`).
@@ -161,7 +160,7 @@ firebase.logout()
161
160
```
162
161
163
162
## resetPassword(credentials)
164
-
Calls Firebase's `firebase.auth().resetPassword()`. If there is an error, it is added into redux state under `state.firebase.authError`, which can be loaded using `pathToJS(state.firebase, 'authError')`.
163
+
Calls Firebase's `firebase.auth().resetPassword()`. If there is an error, it is added into redux state under `state.firebase.authError`.
165
164
166
165
##### Examples
167
166
@@ -174,15 +173,15 @@ firebase.resetPassword({
174
173
```
175
174
176
175
##### Parameters
177
-
* `credentials` [**Object**](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) - Credentials same as described in firebase docs
178
-
* `profile` [**Object**](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) - if initialized with userProfile support then profile will be saved into `${userProfile}/${auth.uid}`
176
+
*`credentials` [**Object**][object-url]- Credentials same as described in firebase docs
177
+
*`profile` [**Object**][object-url]-if initialized with userProfile support then profile will be saved into `${userProfile}/${auth.uid}`
179
178
180
179
##### Returns
181
-
[**Promise**](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) with user's UIDin case of success or the error otherwise.
180
+
[**Promise**][promise-url]with user's UID in case of success or the error otherwise.
182
181
Always authenticate the new user in case of success
183
182
184
183
## confirmPasswordReset(code, newPassword)
185
-
Calls Firebase's `firebase.auth().confirmPasswordReset()`. If there is an error, it is added into redux state under `state.firebase.authError`, which can be loaded using `pathToJS(state.firebase, 'authError')`.
184
+
Calls Firebase's `firebase.auth().confirmPasswordReset()`. If there is an error, it is added into redux state under `state.firebase.authError`.
Verify a password reset code from password reset email.
202
201
203
-
Calls Firebase's `firebase.auth().verifyPasswordResetCode()`. If there is an error, it is added into redux state under `state.firebase.authError`, which can be loaded using `pathToJS(state.firebase, 'authError')`.
202
+
Calls Firebase's `firebase.auth().verifyPasswordResetCode()`. If there is an error, it is added into redux state under `state.firebase.authError`.
Copy file name to clipboardExpand all lines: docs/contributing.md
+13Lines changed: 13 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -5,3 +5,16 @@
5
5
3. Create a pull request on [react-redux-firebase](https://github.com/prescottprue/react-redux-firebase) with a description of your changes
6
6
4. Confirm that you have no merge conflicts that will keep the code from being merged
7
7
5. Keep an eye on the Pull Request for comments/updates
8
+
9
+
10
+
## NPM Linking
11
+
12
+
It is often convenient to run a local version of `react-redux-firebase` within a project to debug issues. The can be accomplished by doing the following:
13
+
14
+
1. Fork `react-redux-firebase` then cloning to your local machine (or download and unzip)
15
+
1. Run `npm link` within your local `react-redux-firebase` folder
16
+
1. Run `npm link react-redux-firebase` in your project (or one of the examples)
17
+
1. Run `npm run watch` in your local `react-redux-firebase` folder to run a watch server that will rebuild as you make changes
18
+
1. Your project should now be pointing to your local version of `react-redux-firebase`
19
+
20
+
**NOTE** The `commonjs` version is what is build when using `npm run watch`. If using a different version, use `npm run build` to build after you make changes.
Copy file name to clipboardExpand all lines: docs/getting_started.md
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -17,15 +17,15 @@ Though they are optional, it is highly recommended that you used decorators with
17
17
18
18
A side by side comparison using [react-redux](https://github.com/reactjs/react-redux)'s `connect` function/HOC is the best way to illustrate the difference:
19
19
20
-
```javascript
20
+
```jsx
21
21
classSomeComponentextendsComponent {
22
22
23
23
}
24
24
exportdefaultconnect()(SomeComponent)
25
25
```
26
26
vs.
27
27
28
-
```javascript
28
+
```jsx
29
29
@connect()
30
30
exportdefaultclassSomeComponentextendsComponent {
31
31
@@ -38,7 +38,7 @@ In order to enable this functionality, you will most likely need to install a pl
38
38
2. Add the following line to your `.babelrc`:
39
39
```json
40
40
{
41
-
"plugins": ["transform-decorators-legacy"]
41
+
"plugins": ["transform-decorators-legacy"]
42
42
}
43
43
```
44
44
@@ -95,7 +95,7 @@ View the [config section](/config.html) for full list of configuration options.
95
95
96
96
## Use in Components
97
97
98
-
```javascript
98
+
```jsx
99
99
importReact, { Component } from'react'
100
100
importPropTypesfrom'prop-types'
101
101
import { connect } from'react-redux'
@@ -158,12 +158,12 @@ Alternatively, if you choose not to use decorators, your connect function will l
0 commit comments