/*
 * SPDX-License-Identifier: GPL-3.0-or-later
 */
package com.runicgateway.app.data.api

import com.runicgateway.app.data.api.dto.MobileRefreshRequest
import com.runicgateway.app.data.api.dto.MobileTokenResponse
import retrofit2.Call
import retrofit2.http.Body
import retrofit2.http.Headers
import retrofit2.http.POST

/**
 * The token-rotation endpoint, isolated onto its own **bare** OkHttp client
 * (no auth interceptor, no authenticator) so refreshing can never recurse
 * through the very [com.runicgateway.app.core.net.TokenAuthenticator] that calls
 * it (PLAN.md §4.3). It is a blocking [Call] because the authenticator runs on an
 * OkHttp dispatcher thread, outside any coroutine, and executes it synchronously.
 *
 * Tagged `NO_SESSION` so it carries no stale bearer.
 */
interface AuthRefreshApi {

    @Headers("X-Runic-No-Session: 1")
    @POST("api/v1/auth/mobile/refresh")
    fun refresh(@Body body: MobileRefreshRequest): Call<MobileTokenResponse>
}
