Skip to content

Commit

Permalink
fix: send auth bearer token when browsing by collection without waiti…
Browse files Browse the repository at this point in the history
…ng for 401

resolves #416
  • Loading branch information
David Ly committed Oct 5, 2023
1 parent 9eff227 commit 8413784
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import timber.log.Timber
val loggingModule = module {
single<Logger> {
object : Logger {
override fun d(text: String) {
Timber.d(text)
}

override fun e(exception: Exception) {
Timber.e(exception)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package ly.david.data.core.logging

interface Logger {
fun d(text: String)
fun e(exception: Exception)
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,14 @@ interface MusicBrainzApi : SearchApi, BrowseApi, LookupApi, CollectionApi, Music
BearerTokens(it, "")
}
}
// TODO: this block is never executed unlike for spotify
refreshTokens {
musicBrainzAuthRepository.getAuthState()?.let {
BearerTokens(it, "")
}
}
// TODO: handle collection browse, one way to do it is to split up the
// api that requires auth and just return true here
sendWithoutRequest { request ->
request.url.pathSegments.contains(USER_INFO)
request.url.parameters["collection"] != null ||
request.url.pathSegments.contains(USER_INFO)
}
}
}
Expand Down

0 comments on commit 8413784

Please sign in to comment.