The initialize() method in the authClientProvider seems to be redundant or confusing. Currently, it's possible to use the authClientProvider.getClient() method and proceed with authentication operations without explicitly calling initialize(). This raises the question: what is the purpose of the initialize() method if the client can function without it?
Steps to Reproduce:
-
Set up the authClientProvider using the following code:
val omhAuthClient = OmhAuthProvider.Builder()
.addNonGmsPath("com.openmobilehub.android.auth.plugin.google.nongms.presentation.OmhAuthFactoryImpl")
.addGmsPath("com.openmobilehub.android.auth.plugin.google.gms.OmhAuthFactoryImpl")
.build()
.provideAuthClient(
context = applicationContext,
scopes = listOf(
"openid",
"email",
"profile",
"https://www.googleapis.com/auth/drive",
"https://www.googleapis.com/auth/drive.file"
),
clientId = "XXXX"
)
-
Attempt to use the client without calling initialize():
lifecycleScope.launch(Dispatchers.IO) {
authClientProvider.getClient(requireContext())
.addOnSuccess {
setupUI()
}
.execute()
}
Expected Behavior:
If initialize() is necessary, the client should not function correctly without it. Alternatively, if it’s not necessary, it should be clarified when and why initialize() should be used.
Actual Behavior:
The client appears to work fine without calling initialize(), which creates confusion about the necessity and role of the initialize() method.
Additional Context:
This issue might lead to developers misunderstanding the API usage or possibly omitting initialize() without knowing its potential benefits or requirements.
The
initialize()method in theauthClientProviderseems to be redundant or confusing. Currently, it's possible to use theauthClientProvider.getClient()method and proceed with authentication operations without explicitly callinginitialize(). This raises the question: what is the purpose of theinitialize()method if the client can function without it?Steps to Reproduce:
Set up the
authClientProviderusing the following code:Attempt to use the client without calling
initialize():Expected Behavior:
If
initialize()is necessary, the client should not function correctly without it. Alternatively, if it’s not necessary, it should be clarified when and whyinitialize()should be used.Actual Behavior:
The client appears to work fine without calling
initialize(), which creates confusion about the necessity and role of theinitialize()method.Additional Context:
This issue might lead to developers misunderstanding the API usage or possibly omitting
initialize()without knowing its potential benefits or requirements.