Paul Davies
06/09/2021, 1:18 PM3.0.0-dev6
to the latest 3.0.0-dev11
, and my BrearerTokenInterceptor
has stopped adding the token into my request headers.
The client creation code has changed as the Builder
API is no longer here (that I can see), so I've changed to this...
return ApolloClient(
networkTransport = ApolloHttpNetworkTransport(
serverUrl = "<https://core-gql-sohj3qqawq-ew.a.run.app/graphql>",
headers = mapOf(
"Accept" to "application/json",
"Content-Type" to "application/json"
)
)
)
.withInterceptor(BearerTokenInterceptor(object : TokenProvider {
override suspend fun currentToken(): String {
return Firebase.auth.currentUser?.getIdToken(false) ?: ""
}
override suspend fun refreshToken(previousToken: String): String {
return Firebase.auth.currentUser?.getIdToken(true) ?: ""
}
}))
.withCustomScalarAdapter(DateTimeAdapter.graphQlName, DateTimeAdapter())
.withCustomScalarAdapter(DateAdapter.graphQlName, DateAdapter())
.withStore(apolloStore)
Have I done something wrong here?
If I put a static string instead of the call to Firebase.auth
it still doesn't add a header. This was all working fine on 3.0.0-dev6
, so I suspect this is something silly I can't see 😬