@steffesgroup/steffes-auth
Advanced tools
Comparing version 0.2.6 to 0.2.7
@@ -6,2 +6,3 @@ import { AxiosInstance, AxiosRequestConfig, AxiosResponse, CancelToken } from 'axios'; | ||
protected transformOptions: (options: AxiosRequestConfig) => Promise<AxiosRequestConfig>; | ||
protected transformResult(url: string, response: AxiosResponse, processor: (response: any) => any): any; | ||
} | ||
@@ -8,0 +9,0 @@ export interface IAuthClient { |
@@ -26,2 +26,9 @@ "use strict"; | ||
} | ||
transformResult(url, response, processor) { | ||
if ((response.status === 400 || response.status === 500) && response.config.method == "post" && response.data && response.data[""] && window) { | ||
let errorEvent = new CustomEvent("steffes:genericHttpError", { detail: { errors: response.data[""] || [] } }); | ||
window.dispatchEvent(errorEvent); | ||
} | ||
return processor(response); | ||
} | ||
} | ||
@@ -63,3 +70,3 @@ exports.AuthorizedApiBase = AuthorizedApiBase; | ||
}).then((_response) => { | ||
return this.processGetToken(_response); | ||
return this.transformResult(url_, _response, (_response) => this.processGetToken(_response)); | ||
}); | ||
@@ -117,3 +124,3 @@ } | ||
}).then((_response) => { | ||
return this.processRefreshToken(_response); | ||
return this.transformResult(url_, _response, (_response) => this.processRefreshToken(_response)); | ||
}); | ||
@@ -172,3 +179,3 @@ } | ||
}).then((_response) => { | ||
return this.processResetPassword(_response); | ||
return this.transformResult(url_, _response, (_response) => this.processResetPassword(_response)); | ||
}); | ||
@@ -233,3 +240,3 @@ } | ||
}).then((_response) => { | ||
return this.processSendResetPassword(_response); | ||
return this.transformResult(url_, _response, (_response) => this.processSendResetPassword(_response)); | ||
}); | ||
@@ -299,3 +306,3 @@ } | ||
}).then((_response) => { | ||
return this.processGetLegacyUserById(_response); | ||
return this.transformResult(url_, _response, (_response) => this.processGetLegacyUserById(_response)); | ||
}); | ||
@@ -302,0 +309,0 @@ } |
{ | ||
"name": "@steffesgroup/steffes-auth", | ||
"version": "0.2.06", | ||
"version": "0.2.07", | ||
"description": "Steffes Auth", | ||
@@ -5,0 +5,0 @@ "main": "dist/api.js", |
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
27314
693