File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 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
4848-  ` logoutUser() ` 
4949-  ` requestPasswordRecovery(email: string) ` 
5050-  ` recoverAccount(token: string, remember?: boolean | undefined) ` 
51- -  ` updateUser(fields: Object ) ` 
51+ -  ` updateUser(fields: { data: object } ) ` 
5252-  ` getFreshJWT() ` 
5353-  ` 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)
5454
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ export type ReactNetlifyIdentityAPI = {
4343    token : string , 
4444    remember ?: boolean  |  undefined 
4545  )  =>  Promise < User > ; 
46-   updateUser : ( fields : Object )  =>  Promise < User  |  undefined > ; 
46+   updateUser : ( fields : {   data :  object   } )  =>  Promise < User  |  undefined > ; 
4747  getFreshJWT : ( )  =>  Promise < string > ; 
4848  authedFetch : { 
4949    get : ( endpoint : string ,  obj ?: { } )  =>  Promise < any > ; 
@@ -153,12 +153,12 @@ export function useNetlifyIdentity(
153153    goTrueInstance . requestPasswordRecovery ( email ) ; 
154154  const  recoverAccount  =  ( token : string ,  remember ?: boolean  |  undefined )  => 
155155    goTrueInstance . recover ( token ,  remember ) ; 
156-   const  updateUser  =  ( fields : Object )  =>  { 
156+   const  updateUser  =  ( fields : {   data :  object   } )  =>  { 
157157    if  ( user  ==  null )  { 
158158      throw  new  Error ( 'No current user found - are you logged in?' ) ; 
159159    }  else  { 
160160      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"   }   } 
162162        . then ( _setUser ) ; 
163163    } 
164164  } ; 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments