package dev.inmo.postssystem.features.common.server.sessions

import dev.inmo.micro_utils.ktor.server.configurators.KtorApplicationConfigurator
import io.ktor.application.Application
import io.ktor.auth.Authentication
import io.ktor.auth.authentication

class ApplicationAuthenticationConfigurator(
    private val elements: List<Element>
) : KtorApplicationConfigurator {
    fun interface Element { operator fun Authentication.Configuration.invoke() }

    override fun Application.configure() {
        authentication {
            elements.forEach { it.apply { invoke() } }
        }
    }
}
