Titan
Titan copied to clipboard
Titan Predicate ignores prior responses
titan.get("/index") { ... }
titan.predicate(isAuthenticated, true: {
titan.get("/user") { ... }
}, false: {
titan.addFunction { "Not Authorised" }
})
A request to /index
will set the response in the chain to be the index page. However, Titan predicate is implemented with a shadowed Titan instance, which by default sets the response to -1
.
I'm loath to change the TitanCore API, though I think that might be required. The other way to do it would be through some kind of equality checking and leapfrogging the prior response to the other side of the inner Titan chain if no match is found.