All Downloads are FREE. Search and download functionalities are using the official Maven repository.

main.com.stytch.java.common.methodoptions.Authorization.kt Maven / Gradle / Ivy

There is a newer version: 6.7.0
Show newest version
package com.stytch.java.common.methodoptions

public data class Authorization(
    private val sessionToken: String? = null,
    private val sessionJwt: String? = null,
) {
    internal fun addHeaders(headers: Map = emptyMap()): Map {
        val authHeaders =
            mutableMapOf().apply {
                if (sessionToken != null) {
                    put("X-Stytch-Member-Session", sessionToken)
                }
                if (sessionJwt != null) {
                    put("X-Stytch-Member-SessionJWT", sessionJwt)
                }
            }
        return authHeaders + headers
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy