Add token renewal backend
This commit is contained in:
@@ -7,6 +7,7 @@ import io.ktor.application.*
|
||||
import org.kodein.di.Kodein
|
||||
import org.kodein.di.generic.bind
|
||||
import org.kodein.di.generic.instance
|
||||
import java.util.concurrent.TimeUnit
|
||||
import javax.sql.DataSource
|
||||
|
||||
/**
|
||||
@@ -29,10 +30,13 @@ fun Application.configurationFeature() {
|
||||
HikariDataSource(hikariConfig)
|
||||
}
|
||||
|
||||
val simpleJwt = SimpleJWT(environment.config.property("jwt.secret").getString())
|
||||
val jwtSecret = environment.config.property("jwt.secret").getString()
|
||||
val authSimpleJwt = SimpleJWT(jwtSecret, 1, TimeUnit.HOURS)
|
||||
val refreshSimpleJwt = SimpleJWT(jwtSecret, 7, TimeUnit.DAYS)
|
||||
|
||||
configurationModule = Kodein.Module("Configuration") {
|
||||
bind<DataSource>() with instance(dataSource)
|
||||
bind<SimpleJWT>() with instance(simpleJwt)
|
||||
bind<SimpleJWT>(tag = "auth") with instance(authSimpleJwt)
|
||||
bind<SimpleJWT>(tag = "refresh") with instance(refreshSimpleJwt)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user