import io.ktor.sessions.*
import io.ktor.util.*
import kotlinx.coroutines.coroutineScope
-import kotlinx.coroutines.flow.filter
-import kotlinx.coroutines.flow.singleOrNull
import kotlinx.coroutines.launch
import kotlinx.html.*
import starshipfights.CurrentConfiguration
val userAgent = request.userAgent()
if (userAgent != null && credentials.name.isValidUsername() && credentials.password == TEST_PASSWORD) {
sfLogger.info("Attempting to find user ${credentials.name}")
- // TODO find out why java mongodb driver is such a piece of shit
- //val user = User.locate(User::username eq credentials.name)
- val user = User.all().filter { it.username == credentials.name }.singleOrNull()
- ?: User(username = credentials.name).also {
+ val user = //User.locate(User::username eq credentials.name)
+ //?: User(username = credentials.name).also {
+ User(username = credentials.name).also {
sfLogger.info("Attempting to add user with name ${credentials.name}")
User.put(it)
}