Tolga ÇAĞLAYAN
03/20/2023, 5:43 PMfun isTokenBlacklistedAdmin(token: Payload): Boolean {
val fetch = transaction {
AdminTokenTable.select {
AdminTokenTable.token eq token.toString()
}.firstOrNull()?.let {
AdminTokenList(
token = it[AdminTokenTable.token],
blackList = it[AdminTokenTable.blackList]
)
}
}
return when (
fetch?.blackList
) {
1 -> {
true
}
0 -> {
println("0")
false
}
else -> {
true
}
}
}
I have such a code block. While performing JWT validation, I want to check from the database whether the token is blacklisted. But how can I read the token from Payload? token.toString() doesn't work. I couldn't find any detailed information.Berkay Özkan
03/20/2023, 5:56 PMTolga ÇAĞLAYAN
03/20/2023, 6:14 PM