@@ -44,34 +44,36 @@ export class AuthApiClient {
4444 fullName,
4545 companyName,
4646 emailNotifications,
47+ token,
4748 } : {
4849 fullName ?: string ;
4950 companyName ?: string ;
5051 emailNotifications ?: string ;
52+ token : string ;
5153 } ) {
5254 await fetch ( `${ this . endpoint } /auth/profile` , {
5355 method : "PUT" ,
5456 body : JSON . stringify ( { fullName, companyName, emailNotifications } ) ,
5557 headers : {
56- Authorization : this . session ?. getIdToken ( ) . getJwtToken ( ) || "" ,
58+ Authorization : token ,
5759 } ,
5860 } ) ;
5961 }
6062
61- async deleteUserProfile ( ) {
63+ async deleteUserProfile ( token : string ) {
6264 await fetch ( `${ this . endpoint } /auth` , {
6365 method : "DELETE" ,
6466 headers : {
65- Authorization : this . session ?. getIdToken ( ) . getJwtToken ( ) || "" ,
67+ Authorization : token ,
6668 } ,
6769 } ) ;
6870 }
6971
70- async uploadUserProfileImage ( image : any ) {
72+ async uploadUserProfileImage ( image : any , token : string ) {
7173 const response = await fetch ( `${ this . endpoint } /auth/profile/image` , {
7274 method : "POST" ,
7375 headers : {
74- Authorization : this . session ?. getIdToken ( ) . getJwtToken ( ) || "" ,
76+ Authorization : token ,
7577 } ,
7678 } ) ;
7779
@@ -85,7 +87,7 @@ export class AuthApiClient {
8587 return data ;
8688 }
8789
88- async getUserKeys ( ) {
90+ async getUserKeys ( token : string ) {
8991 const response = await fetch ( `${ this . endpoint } /keys/user` , {
9092 method : "POST" ,
9193 headers : {
@@ -101,7 +103,7 @@ export class AuthApiClient {
101103 const response = await fetch ( `${ this . endpoint } /keys/user` , {
102104 method : "POST" ,
103105 headers : {
104- Authorization : this . session ?. getIdToken ( ) . getJwtToken ( ) || "" ,
106+ Authorization : token ,
105107 } ,
106108 body : JSON . stringify ( { page : index + 2 } ) ,
107109 } ) ;
@@ -118,12 +120,16 @@ export class AuthApiClient {
118120 return keys ;
119121 }
120122
121- async updateItemKeys ( encryptionPublicKey : string , encryptedItemKeys : any ) {
123+ async updateItemKeys (
124+ encryptionPublicKey : string ,
125+ encryptedItemKeys : any ,
126+ token : string
127+ ) {
122128 await fetch ( `${ this . endpoint } /auth/password` , {
123129 method : "POST" ,
124130
125131 headers : {
126- Authorization : this . session ?. getIdToken ( ) . getJwtToken ( ) || "" ,
132+ Authorization : token ,
127133 } ,
128134 body : JSON . stringify ( {
129135 encryptionPublicKey,
0 commit comments