@@ -78,6 +78,7 @@ export async function setUserInfo(user_info) {
7878export async function logout ( ) {
7979 const response = await fetch ( LOGOUT , {
8080 method : 'POST' ,
81+ credentials : 'include' ,
8182 headers : await headerGenerator ( true ) ,
8283 } )
8384 if ( response . status !== 200 && response . status !== 401 ) {
@@ -136,6 +137,7 @@ export async function getAvatar(avatarId, displayName = null, isRefresh = false)
136137 if ( isRefresh || ! avatar || ( Date . now ( ) - avatar [ 'Date' ] ) > CACHE_EXPIRATION ) {
137138 const response = await fetch ( GET_AVATAR , {
138139 method : 'POST' ,
140+ credentials : 'include' ,
139141 headers : await headerGenerator ( true ) ,
140142 body : JSON . stringify ( { avatar_id : avatarId } )
141143 } )
@@ -212,6 +214,7 @@ export async function getDisplayName(isRefresh = false) {
212214 if ( isRefresh || ! displayName || ( Date . now ( ) - displayName [ 'Date' ] ) > CACHE_EXPIRATION ) {
213215 const response = await fetch ( GET_DISPLAY_NAME , {
214216 method : 'POST' ,
217+ credentials : 'include' ,
215218 headers : await headerGenerator ( true ) ,
216219 } )
217220 await handleErrors ( response ) ;
@@ -242,6 +245,7 @@ export async function toggleAnonymous() {
242245
243246 const response = await fetch ( TOGGLE_NICKNAME , {
244247 method : 'POST' ,
248+ credentials : 'include' ,
245249 headers : await headerGenerator ( true ) ,
246250 } ) ;
247251 await handleErrors ( response ) ;
0 commit comments