File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ yarn add react-netlify-identity
48
48
- ` logoutUser() `
49
49
- ` requestPasswordRecovery(email: string) `
50
50
- ` recoverAccount(token: string, remember?: boolean | undefined) `
51
- - ` updateUser(fields: Object ) `
51
+ - ` updateUser(fields: { data: object } ) `
52
52
- ` getFreshJWT() `
53
53
- ` authedFetch(endpoint: string, obj = {}) ` (a thin axios-like wrapper over ` fetch ` that has the user's JWT attached, for convenience pinging Netlify Functions with Netlify Identity)
54
54
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ export type ReactNetlifyIdentityAPI = {
43
43
token : string ,
44
44
remember ?: boolean | undefined
45
45
) => Promise < User > ;
46
- updateUser : ( fields : Object ) => Promise < User | undefined > ;
46
+ updateUser : ( fields : { data : object } ) => Promise < User | undefined > ;
47
47
getFreshJWT : ( ) => Promise < string > ;
48
48
authedFetch : {
49
49
get : ( endpoint : string , obj ?: { } ) => Promise < any > ;
@@ -153,12 +153,12 @@ export function useNetlifyIdentity(
153
153
goTrueInstance . requestPasswordRecovery ( email ) ;
154
154
const recoverAccount = ( token : string , remember ?: boolean | undefined ) =>
155
155
goTrueInstance . recover ( token , remember ) ;
156
- const updateUser = ( fields : Object ) => {
156
+ const updateUser = ( fields : { data : object } ) => {
157
157
if ( user == null ) {
158
158
throw new Error ( 'No current user found - are you logged in?' ) ;
159
159
} else {
160
160
return user !
161
- . update ( fields ) // e.g. { email: "example@example.com", password: "password" }
161
+ . update ( fields ) // e.g. { data: { email: "example@example.com", password: "password" } }
162
162
. then ( _setUser ) ;
163
163
}
164
164
} ;
You can’t perform that action at this time.
0 commit comments