Skip to content

Commit

Permalink
Merge pull request #284 from UKHomeOffice/DRTII-1541-New-users-gettin…
Browse files Browse the repository at this point in the history
…g-404-when-trying-to-access-port

Drtii 1541 new users getting 404 when trying to access port
  • Loading branch information
richbirch authored Jul 22, 2024
2 parents 9454d33 + c5c7c79 commit 7b55627
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import sbt.Keys.resolvers

lazy val drtLibVersion = "v843"
lazy val drtLibVersion = "v858"
lazy val drtCiriumVersion = "203"
lazy val akkaHttpVersion = "10.5.3"
lazy val akkaVersion = "2.8.5"
Expand Down
2 changes: 1 addition & 1 deletion react/src/services/ApiClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default class ApiClient implements IApiClient {
public static userEndPoint = "/api/user"
public static userTrackingEndPoint = "/api/track-user"
public static configEndPoint = "/api/config"
public static logoutEndPoint = "/oauth/logout"
public static logoutEndPoint = "/oauth2/sign_out"
public static alertsEndPoint = "/api/alerts"
public static healthChecks = "/api/health-checks"
public static healthCheckAlarmStatuses = "/api/health-checks/alarm-statuses"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ case class IndexRoute(urls: Urls, indexResource: Route) {
val user = User.fromRoles("", rolesStr)
if (user.accessiblePorts.contains(portCode)) {
val portLogoutUrl = urls.logoutUrlForPort(portCode)
log.info(s"Redirecting back to $portCode ($portLogoutUrl)")
log.info(s"DRT v2's user session is out of date. Redirecting user to log out of port $portCode ($portLogoutUrl)")
redirect(portLogoutUrl, StatusCodes.TemporaryRedirect)
} else {
log.info(s"Redirecting to root url as originating $portCode is not available to user")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class IndexRouteSpec extends Specification with Specs2RouteTest {
Get("/?fromPort=lhr") ~>
RawHeader("X-Forwarded-Groups", Seq(BorderForceStaff.name, LHR.name).mkString(",")) ~> routes ~> check {
val isTempRedirected = status shouldEqual StatusCodes.TemporaryRedirect
val isLhrLogoutUrl = header("Location") shouldEqual Option(Location(s"$lhrUrl/oauth/logout?redirect=$lhrUrl"))
val isLhrLogoutUrl = header("Location") shouldEqual Option(Location(s"$lhrUrl/oauth2/sign_out?redirect=$lhrUrl"))
isTempRedirected && isLhrLogoutUrl
}
}
Expand Down

0 comments on commit 7b55627

Please sign in to comment.