Skip to content

Commit 57259d9

Browse files
committed
fixup! Merge remote-tracking branch 'origin/develop' into kshitij/custom-auth-2
1 parent 60ce739 commit 57259d9

File tree

7 files changed

+14
-9
lines changed

7 files changed

+14
-9
lines changed

app/src/main/java/org/openedx/app/AppActivity.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ class AppActivity : AppCompatActivity(), InsetHolder, WindowSizeHolder {
6969
private val authCode: String?
7070
get() {
7171
val data = intent?.data
72-
if (data is Uri && data.scheme == BuildConfig.APPLICATION_ID && data.host == ApiConstants.BrowserLogin.REDIRECT_HOST) {
72+
if (
73+
data is Uri &&
74+
data.scheme == BuildConfig.APPLICATION_ID &&
75+
data.host == ApiConstants.BrowserLogin.REDIRECT_HOST
76+
) {
7377
return data.getQueryParameter(ApiConstants.BrowserLogin.CODE_QUERY_PARAM)
7478
}
7579
return null

app/src/main/java/org/openedx/app/di/ScreenModule.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ val screenModule = module {
104104
)
105105
}
106106

107-
viewModel { (courseId: String?, infoType: String?, authCode:String) ->
107+
viewModel { (courseId: String?, infoType: String?, authCode: String) ->
108108
SignInViewModel(
109109
get(),
110110
get(),

auth/src/main/java/org/openedx/auth/presentation/logistration/LogistrationFragment.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,11 @@ class LogistrationFragment : Fragment() {
6969
OpenEdXTheme {
7070
LogistrationScreen(
7171
onSignInClick = {
72-
if(viewModel.isBrowserLoginEnabled) {
72+
if (viewModel.isBrowserLoginEnabled) {
7373
viewModel.signInBrowser(requireActivity())
7474
} else {
7575
viewModel.navigateToSignIn(parentFragmentManager)
7676
}
77-
7877
},
7978
onRegisterClick = {
8079
if (viewModel.isBrowserRegistrationEnabled) {

auth/src/main/java/org/openedx/auth/presentation/logistration/LogistrationViewModel.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import org.openedx.auth.presentation.AuthAnalyticsKey
1010
import org.openedx.auth.presentation.AuthRouter
1111
import org.openedx.auth.presentation.sso.BrowserAuthHelper
1212
import org.openedx.core.config.Config
13+
import org.openedx.core.utils.Logger
1314
import org.openedx.foundation.extension.takeIfNotEmpty
1415
import org.openedx.foundation.presentation.BaseViewModel
15-
import org.openedx.core.utils.Logger
1616

1717
class LogistrationViewModel(
1818
private val courseId: String,

auth/src/main/java/org/openedx/auth/presentation/signin/SignInViewModel.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ import org.openedx.auth.domain.interactor.AuthInteractor
1818
import org.openedx.auth.domain.model.SocialAuthResponse
1919
import org.openedx.auth.presentation.AgreementProvider
2020
import org.openedx.auth.presentation.AuthAnalytics
21-
import org.openedx.auth.presentation.sso.BrowserAuthHelper
2221
import org.openedx.auth.presentation.AuthAnalyticsEvent
2322
import org.openedx.auth.presentation.AuthAnalyticsKey
2423
import org.openedx.auth.presentation.AuthRouter
24+
import org.openedx.auth.presentation.sso.BrowserAuthHelper
2525
import org.openedx.auth.presentation.sso.OAuthHelper
2626
import org.openedx.core.Validator
2727
import org.openedx.core.config.Config

auth/src/main/java/org/openedx/auth/presentation/sso/BrowserAuthHelper.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ class BrowserAuthHelper(private val config: Config) {
1818
logger.d { "Browser-based auth initiated" }
1919
val uri = Uri.parse("${config.getApiHostURL()}${ApiConstants.URL_AUTHORIZE}").buildUpon()
2020
.appendQueryParameter("client_id", config.getOAuthClientId())
21-
.appendQueryParameter("redirect_uri", "${activityContext.packageName}://${ApiConstants.BrowserLogin.REDIRECT_HOST}")
21+
.appendQueryParameter(
22+
"redirect_uri",
23+
"${activityContext.packageName}://${ApiConstants.BrowserLogin.REDIRECT_HOST}"
24+
)
2225
.appendQueryParameter("response_type", ApiConstants.BrowserLogin.RESPONSE_TYPE).build()
2326
val intent =
2427
CustomTabsIntent.Builder().setUrlBarHidingEnabled(true).setShowTitle(true).build()
2528
intent.intent.setFlags(FLAG_ACTIVITY_NEW_TASK)
26-
logger.d { "Launching custom tab with ${uri.toString()}"}
2729
intent.launchUrl(activityContext, uri)
2830
}
2931

auth/src/test/java/org/openedx/auth/presentation/signin/SignInViewModelTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ import org.openedx.auth.R
2525
import org.openedx.auth.domain.interactor.AuthInteractor
2626
import org.openedx.auth.presentation.AgreementProvider
2727
import org.openedx.auth.presentation.AuthAnalytics
28-
import org.openedx.auth.presentation.sso.BrowserAuthHelper
2928
import org.openedx.auth.presentation.AuthRouter
29+
import org.openedx.auth.presentation.sso.BrowserAuthHelper
3030
import org.openedx.auth.presentation.sso.OAuthHelper
3131
import org.openedx.core.Validator
3232
import org.openedx.core.config.Config

0 commit comments

Comments
 (0)