File tree Expand file tree Collapse file tree 3 files changed +14
-7
lines changed
src/main/java/com/codandotv/streamplayerapp/core_networking/di Expand file tree Collapse file tree 3 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -11,5 +11,10 @@ object Config {
1111 object BuildField {
1212 const val host_debug = " \" https://api.themoviedb.org/3/\" "
1313 const val host_release = " \" https://api.themoviedb.org/3/\" "
14+
15+ private const val tmdb_token_name_debug = " TMDB_BEARER_TOKEN_DEBUG"
16+ private const val tmdb_token_name_release = " TMDB_BEARER_TOKEN_RELEASE"
17+ val api_bearer_debug = " \" Bearer ${System .getenv(tmdb_token_name_debug) ? : " " } \" "
18+ val api_bearer_release = " \" Bearer ${System .getenv(tmdb_token_name_release) ? : " " } \" "
1419 }
1520}
Original file line number Diff line number Diff line change 1- android{
1+ android {
22 namespace = " ${Config .packageName} core_networking"
33
4- buildTypes{
5- getByName(" debug" ){
6- buildConfigField(" String" ," HOST" ,Config .BuildField .host_debug)
4+ buildTypes {
5+ getByName(" debug" ) {
6+ buildConfigField(" String" , " HOST" , Config .BuildField .host_debug)
7+ buildConfigField(" String" , " API_BEARER_AUTH" , Config .BuildField .api_bearer_debug)
78 }
8- getByName(" release" ){
9- buildConfigField(" String" ," HOST" ,Config .BuildField .host_release)
9+ getByName(" release" ) {
10+ buildConfigField(" String" , " HOST" , Config .BuildField .host_release)
11+ buildConfigField(" String" , " API_BEARER_AUTH" , Config .BuildField .api_bearer_release)
1012 }
1113 }
1214}
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ object NetworkModule {
3131 .newBuilder()
3232 .addHeader(
3333 " Authorization" ,
34- " Bearer eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJiNDg2NWM4YTAzNzhmM2I4NjI0OWU1ZjNiYWFiMjU2NyIsInN1YiI6IjY0Mjk4YTg5YTNlNGJhMWM0NDgzM2U4OCIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.9cIxv29vkaZ2yW88DIFRUFK_nXbK2b6KS8t96kA8WAE "
34+ BuildConfig . API_BEARER_AUTH
3535 )
3636 .addHeader(" Content-Type" , " application/json;charset=utf-8" )
3737 .build()
You can’t perform that action at this time.
0 commit comments