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
-`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
58
58
-`param: TokenParam`
59
59
- 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
62
60
-**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)
63
61
- 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
65
65
66
66
```tsx
67
67
importReactfrom'react';
@@ -258,14 +258,14 @@ function CatchNetlifyRecoveryNullComponent() {
258
258
returnnull;
259
259
}
260
260
261
-
functionRecoveyPage() {
261
+
functionRecoveryPage() {
262
262
const {
263
263
location: { state },
264
264
} =useHistory();
265
265
// this state _might_ not be needed, it was needed in my specific implementation
266
266
const [token] =useState(state?.token);
267
267
268
-
returnnull; //do something with the token
268
+
returnnull; //set new password in a form and call updateUser
0 commit comments