Skip to content

Commit

Permalink
Merge pull request #103 from metabrainz/update-credentials
Browse files Browse the repository at this point in the history
Change redirect uri and update credentials
  • Loading branch information
akshaaatt authored Dec 26, 2021
2 parents c54635a + 16f5e40 commit f86515e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ object MusicBrainzServiceGenerator {
const val API_BASE_URL = "https://musicbrainz.org/ws/2/"
const val AUTH_BASE_URL = "https://musicbrainz.org/oauth2/"
const val ACOUST_ID_BASE_URL = "https://api.acoustid.org/v2/lookup"
const val CLIENT_ID = "BZn9PT8PXtzoUvR1ZIaXFw"
const val CLIENT_SECRET = "WN6o5cjehjPAP4dib0zOmQ"
const val CLIENT_ID = "DfX8Xv3B5Cbco8nZgd6KYMS504F3gmJx"
const val CLIENT_SECRET = "XypxMsphalFfTIh_IagjcsIlSKuUWoc-"
const val OAUTH_REDIRECT_URI = "org.metabrainz.android://oauth"
const val ACOUST_ID_KEY = "5mgEECwRkp"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class LoginActivity : MusicBrainzActivity() {
setContentView(binding!!.root)
supportActionBar!!.setBackgroundDrawable(ColorDrawable(resources.getColor(R.color.app_bg)))
supportActionBar!!.setDisplayHomeAsUpEnabled(true)
loginViewModel = ViewModelProvider(this).get(LoginViewModel::class.java)
loginViewModel = ViewModelProvider(this)[LoginViewModel::class.java]
loginViewModel!!.accessTokenLiveData!!.observe(this) { accessToken: AccessToken? ->
saveOAuthToken(accessToken)
}
Expand All @@ -47,8 +47,7 @@ class LoginActivity : MusicBrainzActivity() {

override fun onResume() {
val callbackUri = intent.data
if (callbackUri != null &&
callbackUri.toString().startsWith(MusicBrainzServiceGenerator.OAUTH_REDIRECT_URI)) {
if (callbackUri != null && callbackUri.toString().startsWith(MusicBrainzServiceGenerator.OAUTH_REDIRECT_URI)) {
val code = callbackUri.getQueryParameter("code")
if (code != null) loginViewModel!!.fetchAccessToken(code)
}
Expand Down

0 comments on commit f86515e

Please sign in to comment.