Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISTE-11: Fixed Redirect logout url, Fixed breadcrumb need to hide #424

Merged
merged 6 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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");
jagankumar-egov marked this conversation as resolved.
Show resolved Hide resolved
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