File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
src/services/authentication/http Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -99,10 +99,16 @@ export class HttpAuthentication extends DeepstreamPlugin implements DeepstreamAu
9999
100100 if ( this . settings . permittedStatusCodes . indexOf ( response . statusCode ) === - 1 ) {
101101 if ( this . settings . reportInvalidParameters ) {
102- if ( typeof response . body === 'string' && response . body ) {
103- callback ( { isValid : false , clientData : { error : response . body } } )
102+ if ( response . body ) {
103+ if ( typeof response . body === 'string' ) {
104+ callback ( { isValid : false , clientData : { error : response . body } } )
105+ } else if ( typeof response . body === 'object' && Object . keys ( response . body ) . length > 0 ) {
106+ callback ( { isValid : false , clientData : { ...response . body } } )
107+ } else {
108+ callback ( { isValid : false } )
109+ }
104110 } else {
105- callback ( { isValid : false , ... response . body } )
111+ callback ( { isValid : false } )
106112 }
107113 } else {
108114 callback ( null )
You can’t perform that action at this time.
0 commit comments