Skip to content

Commit

Permalink
fix: #1179 bceid login bug fix (#1255)
Browse files Browse the repository at this point in the history
  • Loading branch information
MCatherine1994 authored Mar 19, 2024
1 parent eb815a0 commit f6e0dc5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
13 changes: 13 additions & 0 deletions frontend/src/router/routeHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,19 @@ export const beforeEachRouteHandler = async (
return { path: routeItems.landing.path };
}

// if the login user does not have any access, return access error
if (
to.path !== '/' &&
LoginUserState.state.value.famLoginUser?.accesses?.length == 0
) {
const routeError = new FamRouteError(
RouteErrorName.NOT_AUTHENTICATED_ERROR,
'You do not have any access in FAM',
{ to, from }
);
emitRouteToastError(routeError);
}

// Application selected guard.
if (to.meta.requiresAppSelected && !isApplicationSelected.value) {
const routeError = new FamRouteError(
Expand Down
4 changes: 1 addition & 3 deletions infrastructure/server/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ output "fam_cognito_domain" {

output "frontend_logout_chain_url" {
description = "Url of Siteminder and Keycloak logout chain for FAM frontend"
value = var.target_env == "prod" ? var.cognito_app_client_logout_chain_url.prod : (
var.target_env == "test" ? var.cognito_app_client_logout_chain_url.test :
var.cognito_app_client_logout_chain_url.dev)
value = var.target_env == "prod" ? var.cognito_app_client_logout_chain_url.prod : var.cognito_app_client_logout_chain_url.test
}

output "front_end_redirect_base_url" {
Expand Down
6 changes: 0 additions & 6 deletions infrastructure/server/variables_provided.tf
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,6 @@ variable "cognito_app_client_logout_chain_url" {

# Variables for FAM front-end config

variable "frontend_logout_chain_url" {
description = "Url of Siteminder and Keycloak logout chain for frontend"
type = string
default = "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi?retnow=1&returl=https://dev.loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/logout?redirect_uri="
}

variable "front_end_redirect_path" {
description = "Path to public FAM front-end (for redirect URI)"
type = string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@ VALUES
('JFERREIR','I','test-idir_278f48bd9mangledf7e618d@idir',CURRENT_USER),
('NSAGLION','I','test-idir_3f1414bd1mangled18a1293c40@idir',CURRENT_USER),
('CMENG','I','test-idir_a9888e8ac6a04mangled35df625bf@idir',CURRENT_USER),
('OLIBERCH','I','test-idir_b7e191fa11dmangled9df1854b71@idir',CURRENT_USER);
('OLIBERCH','I','test-idir_b7e191fa11dmangled9df1854b71@idir',CURRENT_USER),
('LOAD-3-TEST', 'B', 'test-bceidbusiness_81069f39b35b4861bdmangled9dcd010582b63b112@bceidbusiness',CURRENT_USER);

0 comments on commit f6e0dc5

Please sign in to comment.