Skip to content

Commit

Permalink
ISTE-11: Fixed Redirect logout url, Fixed breadcrumb need to hide (#424)
Browse files Browse the repository at this point in the history
* ISTE-11: Fixed Redirect logout url, Fixed breadcrumb need to hide

* ISTE-11: Added or operator

* ISTE-11: Upgraded package.json , Removed inline css

* ISTE-11: Updated logout redirect url

* Update index.js

---------

Co-authored-by: Jagankumar <[email protected]>
  • Loading branch information
anilsingha-eGov and jagankumar-egov authored May 3, 2024
1 parent 2873b1f commit ae27835
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 21 deletions.
2 changes: 1 addition & 1 deletion micro-ui/web/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
],
"homepage": "/core-ui",
"dependencies": {
"@egovernments/digit-ui-libraries": "1.8.0",
"@egovernments/digit-ui-libraries": "1.8.1",
"@egovernments/digit-ui-module-workbench": "1.0.1",
"@egovernments/digit-ui-module-core": "1.8.1",
"@egovernments/digit-ui-module-pgr": "1.8.0",
Expand Down
2 changes: 1 addition & 1 deletion micro-ui/web/micro-ui-internals/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"start": "react-scripts start"
},
"devDependencies": {
"@egovernments/digit-ui-libraries": "1.8.0",
"@egovernments/digit-ui-libraries": "1.8.1",
"@egovernments/digit-ui-module-workbench": "1.0.1",
"@egovernments/digit-ui-module-dss": "1.8.0",
"@egovernments/digit-ui-module-core": "1.8.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export default App;
### Changelog

```bash
1.8.1 Added logoutRedirectURL for mgramseva workbench
1.8.0 Released as part of workbench v1.0
```

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@egovernments/digit-ui-libraries",
"version": "1.8.0",
"version": "1.8.1",
"main": "dist/index.js",
"module": "dist/index.modern.js",
"source": "src/index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@ import { Request, ServiceRequest } from "../../atoms/Utils/Request";
import { Storage } from "../../atoms/Utils/Storage";

export const UserService = {
authenticate: async(details) => {
authenticate: async (details) => {
const data = new URLSearchParams();
Object.entries(details).forEach(([key, value]) => data.append(key, value));
data.append("scope", "read");
data.append("grant_type", "password");
let authResponse= await ServiceRequest({

let authResponse = await ServiceRequest({
serviceName: "authenticate",
url: Urls.Authenticate,
data,
headers: {
authorization: `Basic ${window?.globalConfigs?.getConfig("JWT_TOKEN")||"ZWdvdi11c2VyLWNsaWVudDo="}`,
authorization: `Basic ${window?.globalConfigs?.getConfig("JWT_TOKEN") || "ZWdvdi11c2VyLWNsaWVudDo="}`,
"Content-Type": "application/x-www-form-urlencoded",
},
});
const invalidRoles = window?.globalConfigs?.getConfig("INVALIDROLES") || [];
if (invalidRoles && invalidRoles.length > 0 && authResponse && authResponse?.UserRequest?.roles?.some((role) => invalidRoles.includes(role.code))) {
throw new Error("ES_ERROR_USER_NOT_PERMITTED");
}
return authResponse;
const invalidRoles = window?.globalConfigs?.getConfig("INVALIDROLES") || [];
if (invalidRoles && invalidRoles.length > 0 && authResponse && authResponse?.UserRequest?.roles?.some((role) => invalidRoles.includes(role.code))) {
throw new Error("ES_ERROR_USER_NOT_PERMITTED");
}
return authResponse;
},
logoutUser: () => {
let user = UserService.getUser();
Expand All @@ -48,18 +48,16 @@ export const UserService = {
},
logout: async () => {
const userType = UserService.getType();
const logoutRedirectURL = window?.globalConfigs?.getConfig("LOGOUT_REDIRECT_URL") || `/${window?.contextPath}/${userType === "citizen"?"citizen":"employee/user/language-selection"}`;
try {
await UserService.logoutUser();
} catch (e) {
}
finally{
finally {
window.localStorage.clear();
window.sessionStorage.clear();
if (userType === "citizen") {
window.location.replace(`/${window?.contextPath}/citizen`);
} else {
window.location.replace(`/${window?.contextPath}/employee/user/language-selection`);
}
window.location.replace(`/${logoutRedirectURL}`);

}
},
sendOtp: (details, stateCode) =>
Expand Down Expand Up @@ -125,7 +123,7 @@ export const UserService = {
});
},
userSearch: async (tenantId, data, filters) => {

return ServiceRequest({
url: Urls.UserSearch,
params: { ...filters },
Expand Down
2 changes: 1 addition & 1 deletion micro-ui/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
],
"homepage": "/digit-ui",
"dependencies": {
"@egovernments/digit-ui-libraries": "1.8.0",
"@egovernments/digit-ui-libraries": "1.8.1",
"@egovernments/digit-ui-module-workbench": "1.0.1",
"@egovernments/digit-ui-module-core": "1.8.1",
"@egovernments/digit-ui-module-hrms": "1.8.0",
Expand Down
2 changes: 1 addition & 1 deletion micro-ui/web/workbench/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
],
"homepage": "/workbench-ui",
"dependencies": {
"@egovernments/digit-ui-libraries": "1.8.0",
"@egovernments/digit-ui-libraries": "1.8.1",
"@egovernments/digit-ui-module-workbench": "1.0.1",
"@egovernments/digit-ui-module-core": "1.8.1",
"@egovernments/digit-ui-react-components": "1.8.0",
Expand Down

0 comments on commit ae27835

Please sign in to comment.