Skip to content

Commit 8e9c709

Browse files
committed
remove outdated updateUser comment & update readme
1 parent 4a16c5c commit 8e9c709

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ yarn add react-netlify-identity
5252
- `loginUser(email: string, password: string, remember: boolean = true)` - we default the `remember` term to `true` since you'll usually want to remember the session in localStorage. set it to false if you need to
5353
- `logoutUser()`
5454
- `requestPasswordRecovery(email: string)`
55-
- `updateUser(fields: { data: object })`
55+
- `updateUser(fields: object)`: see [updateUser @ gotrue-js](https://github.com/netlify/gotrue-js#update-a-user)
5656
- `getFreshJWT()`
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`

src/index.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export type ReactNetlifyIdentityAPI = {
6262
logoutUser: () => MaybeUserPromise;
6363
requestPasswordRecovery: (email: string) => Promise<void>;
6464
recoverAccount: (remember?: boolean) => MaybeUserPromise;
65-
updateUser: (fields: { data: object }) => MaybeUserPromise;
65+
updateUser: (fields: object) => MaybeUserPromise;
6666
getFreshJWT: () => Promise<string>;
6767
authedFetch: {
6868
get: (endpoint: string, obj?: {}) => Promise<any>;
@@ -235,13 +235,13 @@ export function useNetlifyIdentity(
235235
);
236236

237237
const updateUser = useCallback(
238-
(fields: { data: object }) => {
238+
(fields: object) => {
239239
if (!user) {
240240
throw new Error(errors.noUserFound);
241241
}
242242

243243
return user!
244-
.update(fields) // e.g. { data: { email: "example@example.com", password: "password" } }
244+
.update(fields) // e.g. { email: "example@example.com", password: "password" }
245245
.then(_setUser);
246246
},
247247
[user]

0 commit comments

Comments
 (0)