woocommerce-android
woocommerce-android copied to clipboard
[HACK] Add auto-login universal link for debug builds
Description
Adds support for a universal link that allows automatic login using application password credentials in debug builds. This is useful for developer and testing workflows.
URL Format:
https://woocommerce.com/mobile/auto-login?site=<encoded_site_url>&user=<username>&password=<app_password>
Example (with placeholder credentials):
adb shell "am start -a android.intent.action.VIEW -d 'https://woocommerce.com/mobile/auto-login?site=https%3A%2F%2Fexample.com&user=testuser&password=xxxx-xxxx-xxxx-xxxx'"
Behavior:
- Debug builds only (intent filter in debug manifest)
- If already logged in, navigates directly to main screen
- On success, navigates to main screen
- On error, shows toast and opens login screen
Do not merge, as I am not sure how valuable this is for anyone so I firstly would like to ask
Test Steps
- Install debug build
- Clear app data to ensure logged out state
- Run the adb command above with valid site credentials
- Verify the app logs in and navigates to the main screen
- [x] I have considered if this change warrants release notes and have added them to
RELEASE-NOTES.txtif necessary. Use the "[Internal]" label for non-user-facing changes.
| 2 Errors | |
|---|---|
| :no_entry_sign: | Please add tests for class AutoLoginHandler (or add unit-tests-exemption label to ignore this). |
| :no_entry_sign: | This PR is tagged with status: do not merge label(s). |
Generated by :no_entry_sign: 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.
| App Name | WooCommerce-Wear Android | |
| Platform | ⌚️ Wear OS | |
| Flavor | Jalapeno | |
| Build Type | Debug | |
| Commit | 6114afb50a8b3523f3d3a5f3db3b6300969038c3 | |
| Direct Download | woocommerce-wear-prototype-build-pr15062-6114afb.apk |
📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.
| App Name | WooCommerce Android | |
| Platform | 📱 Mobile | |
| Flavor | Jalapeno | |
| Build Type | Debug | |
| Commit | 6114afb50a8b3523f3d3a5f3db3b6300969038c3 | |
| Direct Download | woocommerce-prototype-build-pr15062-6114afb.apk |