I can do it by doing the following: ``` opt...
# ktor
m
I can do it by doing the following:
Copy code
options("/login") {
            call.response.headers.append("Access-Control-Allow-Origin", "*")
            call.response.headers.append("Access-Control-Allow-Methods", "GET, OPTIONS")
            call.response.status(HttpStatusCode.OK)
        }

        route(loginPath) {
            authentication {
                basicAuthentication("HOYLU") { credentials ->
                    val email = credentials.name.toLowerCase(Locale.ROOT)
                    val userPass = credentials.password
                    ldapAuth(UserEmailCredential(email, userPass))
                }
            }

            get {
                val claims = call.authentication.principal<Person>()?.let { generateClaims(it) } ?: throw RuntimeException("Error generating claims")
                val jwt = generateJwt(claims)
                jwtHandler.store(claims.getStringClaimValue("email"), jwt)
                call.respond(JsonResponse(AuthToken(jwt)))
            }
        }