-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Login] Add ability to force using password for login even for passwordless accounts #13202
base: trunk
Are you sure you want to change the base?
Conversation
Generated by 🚫 Danger |
📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
|
📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.
|
e179e01
to
61128a8
Compare
61128a8
to
e500750
Compare
import com.woocommerce.android.BuildConfig | ||
|
||
@Suppress("SwallowedException") | ||
inline fun <reified T> getBuildConfigValueOrNull(key: String): T? { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wzieba your input would be valuable here, I'm adding a new property to the developer-example.properties
, and I don't want to break the build for anyone who already has the file developer.properties
locally, as when it exists we'll read the properties only from it, meaning the new property won't be added to the BuildConfig
.
As a simple solution for this issue, I added this function here to read the property only when it exists and return null
when it doesn't.
But I think there could be a better approach here: Updating the loadPropertiesWithFallback
function to load properties from both files with priority given to the main file. We can implement this by starting by loading the default values from the fallback
(example) file, then overriding them with the ones from the main one; this will make this logic more resilient to changes to the example file: The developers won't need to update their existing local file unless they need to override a value, WDYT about this?
Closes: #13192
Description
This PR adds a build config that allows the app to ignore the "passwordless" property of accounts and force showing the password screen; this helps when debugging some issues; check this discussion p1734946581847499/1734705327.623279-slack-C6H8C3G23 for more information.
Steps to reproduce
developer-example.properties
file asdeveloper.properties
wc.force_password_login = true
Testing information
false
restores the default behavior.The tests that have been performed
^
Images/gif
RELEASE-NOTES.txt
if necessary. Use the "[Internal]" label for non-user-facing changes.Reviewer (or Author, in the case of optional code reviews):
Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement: