From 128510fe88a8b48c40d722faf8bf7fa6d6baeb93 Mon Sep 17 00:00:00 2001 From: Fabrice Lecomte Date: Fri, 15 Jan 2021 23:28:41 +0100 Subject: [PATCH] Add TODO's --- build.gradle.kts | 3 +-- src/main/kotlin/Application.kt | 2 +- src/main/kotlin/Configuration.kt | 1 + 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 72f7046..1d96e9e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -130,8 +130,7 @@ dependencies { implementation("io.ktor:ktor-locations:$ktor_version") implementation("io.ktor:ktor-auth:$ktor_version") implementation("io.ktor:ktor-auth-jwt:$ktor_version") - implementation("io.ktor:ktor-gson:$ktor_version") - implementation("io.ktor:ktor-auth-jwt:$ktor_version") + implementation("io.ktor:ktor-gson:$ktor_version") /* TODO Can be removed ? */ implementation("io.ktor:ktor-websockets:$ktor_version") implementation("org.koin:koin-ktor:$koinVersion") implementation("io.ktor:ktor-jackson:$ktor_version") diff --git a/src/main/kotlin/Application.kt b/src/main/kotlin/Application.kt index 53d87fe..56b2fe6 100644 --- a/src/main/kotlin/Application.kt +++ b/src/main/kotlin/Application.kt @@ -128,7 +128,7 @@ fun Application.module(env: Env = PROD) { verifier(JwtConfig.verifier) realm = "dc-project.fr" authHeader { call -> - call.request.queryParameters.get("token")?.let { + call.request.queryParameters["token"]?.let { HttpAuthHeader.Single("Bearer", it) } } diff --git a/src/main/kotlin/Configuration.kt b/src/main/kotlin/Configuration.kt index 97b8587..9ebc161 100644 --- a/src/main/kotlin/Configuration.kt +++ b/src/main/kotlin/Configuration.kt @@ -47,6 +47,7 @@ object JwtConfig { /** * Produce a token for this combination of User and Account + * TODO move token creator in other place */ fun makeToken(user: UserI): String = JWT.create() .withSubject("Authentication")