Test refresh tokens and don't refresh them if user doesn't exist anymore

This commit is contained in:
2020-06-15 17:10:06 +02:00
parent 7c364c7295
commit 305772fb20
2 changed files with 68 additions and 0 deletions
+3
View File
@@ -51,6 +51,9 @@ fun Routing.auth(kodein: Kodein) {
return@post call.respondStatus(HttpStatusCode.Unauthorized)
}
if (!userService.userExists(id))
return@post call.respondStatus(HttpStatusCode.Unauthorized)
val response = DualToken(
token = authSimpleJwt.sign(id),
refreshToken = refreshSimpleJwt.sign(id)