Skip to content

Commit

Permalink
Add redirect for technical support users
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-tco committed Mar 26, 2024
1 parent 9b5244d commit b0fd0ec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ ONE_LOGIN_ENABLED=true
SESSION_COOKIE_NAME=session_id
ADMIN_BACKEND_HOST=http:localhost:8081
V2_LOGOUT_URL=http://localhost:8082/v2/logout
APPLICANT_BACKEND_HOST=http://localhost:8080
APPLICANT_BACKEND_HOST=http://localhost:8080
TECHNICAL_SUPPORT_DOMAIN=http://localhost:3000/find/api/admin
3 changes: 3 additions & 0 deletions src/service/user-service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const USER_SERVICE_HOST = process.env.USER_SERVICE_HOST;
const USER_TOKEN_NAME = process.env.USER_TOKEN_NAME;
const TECHNICAL_SUPPORT_DOMAIN = process.env.TECHNICAL_SUPPORT_DOMAIN;

export async function checkUserLoggedIn(userToken: string) {
const requestUrl = `${USER_SERVICE_HOST}/is-user-logged-in`;
Expand Down Expand Up @@ -35,5 +36,7 @@ export function getUserRolesRelatedRedirect(
) {
if (userRoles.isSuperAdmin) return `${adminUrl}/super-admin-dashboard`;
else if (userRoles.isAdmin) return `${adminUrl}/dashboard`;
else if (userRoles.isTechnicalSuppport)
return `${TECHNICAL_SUPPORT_DOMAIN}/api-keys/manage`;
else if (userRoles.isApplicant) return `${applicantUrl}/dashboard`;
}

0 comments on commit b0fd0ec

Please sign in to comment.