Skip to content

Commit 8e30593

Browse files
committed
fix(readme): finish docs
1 parent d71eac9 commit 8e30593

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ yarn add react-netlify-identity
5757
- `authedFetch(endpoint: string, obj: RequestInit = {})` a thin axios-like wrapper over `fetch` that has the user's JWT attached, for convenience pinging Netlify Functions with Netlify Identity
5858
- `param: TokenParam`
5959
- a token exposing Netlify tokens a dev has to implement the actions for; namely `invite`, `recovery`, `email_change` and `access_denied`
60-
- for further reference, please check the [type definition](https://github.com/sw-yx/react-netlify-identity/tree/master/src/token.ts)
61-
- implementation for a Recovery Example below
6260
- **Important:** tokens this package exposes no methods for are automatically handled and will not be passed down - see [runRoutes implementation](https://github.com/sw-yx/react-netlify-identity/master/src/runRoutes.tsx)
6361
- if you don't want this behaviour (added [here](https://github.com/sw-yx/react-netlify-identity/issues/12) in v.0.1.8), pass `runRoutes={false}` to the exposed hook
64-
- `recoverAccount(remember?: boolean)`:
62+
- for further reference, please check the [type definition](https://github.com/sw-yx/react-netlify-identity/tree/master/src/token.ts)
63+
- an example implementation for a Recovery process can be found below
64+
- `recoverAccount(remember?: boolean)`: verifies and consumes the recovery token caught by `runRoutes`, sets user on success
6565

6666
```tsx
6767
import React from 'react';
@@ -258,14 +258,14 @@ function CatchNetlifyRecoveryNullComponent() {
258258
return null;
259259
}
260260

261-
function RecoveyPage() {
261+
function RecoveryPage() {
262262
const {
263263
location: { state },
264264
} = useHistory();
265265
// this state _might_ not be needed, it was needed in my specific implementation
266266
const [token] = useState(state?.token);
267267

268-
return null; // do something with the token
268+
return null; // set new password in a form and call updateUser
269269
}
270270
```
271271

0 commit comments

Comments
 (0)