Consider the Form authorization we implemented in the topic. When we set up the Form authentication, we specified a redirect to the form page in the challenge method. What happens if we leave it blank?
install(Authentication) {
form("myFormAuth") {
userParamName = "username"
passwordParamName = "password"
validate { credentials ->
if (credentials.name == "Admin" && credentials.password == "2425") {
UserIdPrincipal(credentials.name)
} else {
null
}
}
challenge {
//call.respondRedirect("/auth")
}
}
}
Open the IDE and check the result yourself.