SecurityService

class SecurityService(db: DatabaseMysql, secret: String)

Constructors

Link copied to clipboard
fun SecurityService(db: DatabaseMysql, secret: String)

Functions

Link copied to clipboard
suspend fun findUserByCredential(credential: JWTCredential): User?

Get user by id from claim JWTCredential

Link copied to clipboard
suspend fun findUserByID(userId: Int): User?

Get user by id

Link copied to clipboard
suspend fun findValidToken(deviceId: String, tokens: List<Token>): Token?
Link copied to clipboard
fun generateTokenModel(userId: Int, deviceId: String): Token
Link copied to clipboard
fun verify(value: String): Int?

Verify refresh token with get user ID

Properties

Link copied to clipboard
val verifier: JWTVerifier