Skip to content

Instantly share code, notes, and snippets.

@PankajWorks
Created February 3, 2019 16:05
Show Gist options
  • Save PankajWorks/029868ea95b26b49c2c8700f05340d2e to your computer and use it in GitHub Desktop.
Save PankajWorks/029868ea95b26b49c2c8700f05340d2e to your computer and use it in GitHub Desktop.
path("in") {
extractUri { uri =>
val st:Future[String] = getDefaultStrategy("abc").map(st=>st.name).recover{case f => "invalid" }
val urlTo = s match {
case "case1" => UriBuilder.build("abc").withPath(Uri.Path("/test/continue")).withQuery(Uri.Query(uri.rawQueryString))
case "case2" => UriBuilder.build("abc").withPath(Uri.Path("/test/login")).withQuery(Uri.Query(uri.rawQueryString))
case _ => UriBuilder.build("abc").withPath(Uri.Path("/test/login")).withQuery(Uri.Query(uri.rawQueryString))
}
// After the future resolve we want to redirect using redirect(urlTo, StatusCodes.SeeOther)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment