Skip to content

Commit

Permalink
adjust a few references to the OAuth auth module for some restructuri…
Browse files Browse the repository at this point in the history
…ng we are doing
  • Loading branch information
frett committed May 31, 2024
1 parent 7220729 commit c616029
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,23 @@ package org.wycliffe.mypd.app.dagger

import dagger.Module
import dagger.Provides
import dagger.Reusable
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import org.ccci.gto.android.common.dagger.eager.EagerModule
import org.mpdx.android.library.oauth.listener.OAuthAppListener
import org.mpdx.android.library.oauth.OAuthConfig
import org.wycliffe.mypd.BuildConfig

@InstallIn(SingletonComponent::class)
@Module(includes = [EagerModule::class])
class AuthorizationAppModule {

@Provides
fun providesOAuthAppConstant(): OAuthAppListener {
return object : OAuthAppListener {
override fun authProvider() = BuildConfig.AUTH_PROVIDER

override fun authorizationEndPoint() = BuildConfig.AUTH_END_POINT

override fun clientId() = BuildConfig.CLIENT_ID

override fun redirectUri() = BuildConfig.REDIRECT_URI

override fun tokenEndPoint() = BuildConfig.TOKEN_END_POINT
}
}
@Reusable
fun oauthConfig() = OAuthConfig(
authorizationEndPoint = BuildConfig.AUTH_END_POINT,
tokenEndPoint = BuildConfig.TOKEN_END_POINT,
clientId = BuildConfig.CLIENT_ID,
redirectUri = BuildConfig.REDIRECT_URI,
authProvider = BuildConfig.AUTH_PROVIDER,
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import org.greenrobot.eventbus.Subscribe
import org.mpdx.android.core.UserDeviceApi
import org.mpdx.android.core.model.UserDevice
import org.mpdx.android.core.services.ConnectivityService
import org.mpdx.android.library.auth.AuthenticationListener
import org.mpdx.android.library.core.AppConstantListener
import org.mpdx.android.library.core.AuthenticationListener
import timber.log.Timber
import java.io.IOException
import javax.inject.Inject
Expand Down Expand Up @@ -40,7 +40,7 @@ class FirebaseMessagingManager @Inject constructor(
}

private fun registerDevice() = launch {
if (authenticationListener.getSessionGuid() == null) return@launch
if (!authenticationListener.isAuthenticated()) return@launch

try {
FirebaseInstanceId.getInstance().instanceId.await()
Expand Down
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ kotlin = "1.9.20"
kotlinCoroutines = "1.7.3"
kotlinKover = "0.7.5"
ktlint = "0.50.0"
mpdxLib = "3.0.5-SNAPSHOT"
mpdxLib = "3.1.0-SNAPSHOT"
moshi = "1.15.0"
okhttp3 = "4.12.0"
realm = "10.17.0"
Expand Down Expand Up @@ -105,8 +105,8 @@ leakcanary = "com.squareup.leakcanary:leakcanary-android:2.12"
materialComponents = "com.google.android.material:material:1.10.0"
mpdx-lib-lib = { module = "org.cru.mpdx.android:library", version.ref = "mpdxLib"}
mpdx-lib-core = { module ="org.cru.mpdx.android:core", version.ref = "mpdxLib"}
mpdx-lib-okta = { module ="org.cru.mpdx.android:okta", version.ref = "mpdxLib"}
mpdx-lib-oauth = { module ="org.cru.mpdx.android:oauth", version.ref = "mpdxLib"}
mpdx-lib-okta = { module ="org.cru.mpdx.android:auth-okta", version.ref = "mpdxLib"}
mpdx-lib-oauth = { module ="org.cru.mpdx.android:auth-oauth", version.ref = "mpdxLib"}
mockito = "org.mockito:mockito-inline:5.2.0"
mockito-kotlin = "org.mockito.kotlin:mockito-kotlin:5.2.1"
mockk = "io.mockk:mockk:1.13.8"
Expand Down

0 comments on commit c616029

Please sign in to comment.