package ru.forbion.f7cloud.core.network

import okhttp3.Credentials
import okhttp3.Interceptor
import okhttp3.Response

class BasicAuthInterceptor(
    private val username: String,
    private val appPassword: String,
) : Interceptor {
    override fun intercept(chain: Interceptor.Chain): Response {
        val req = chain.request().newBuilder()
            .header("Authorization", Credentials.basic(username, appPassword))
            .build()
        return chain.proceed(req)
    }
}
