element-hq / element-x-android

Android Matrix messenger application using the Matrix Rust Sdk and Jetpack Compose
GNU Affero General Public License v3.0
1.08k stars 155 forks source link

Temporary account creation using Element Web. #3467

Closed bmarty closed 2 months ago

bmarty commented 2 months ago

Content

Add ability to create an account directly from Element X, but using a Url of an Element Web instance.

Motivation and context

Give a temporary way for users to create account, waiting for MAS to be available on matrix.org.

Screenshots / GIFs

AccountCreation

Tests

Note: account creation on matrix.org needs that the URL https://matrix.org/.well-known/element/element.json return some Json. In the mean time, this is possible to test by letting DefaultWebClientUrlForAuthenticationRetriever.retrieve return the value "https://pr42--matrix-react-sdk.netlify.app/#/mobile_register"

Using password

Using Oidc

Tested devices

Checklist

github-actions[bot] commented 2 months ago

:iphone: Scan the QR code below to install the build (arm64 only) for this PR. QR code If you can't scan the QR code you can install the build via this link: https://i.diawi.com/npMpQT

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 60.16598% with 96 lines in your changes missing coverage. Please review.

Project coverage is 82.52%. Comparing base (764692b) to head (7f1d9bb). Report is 26 commits behind head on develop.

Files with missing lines Patch % Lines
...in/impl/screens/createaccount/CreateAccountView.kt 53.62% 30 Missing and 2 partials :warning:
...screens/createaccount/WebViewMessageInterceptor.kt 0.00% 27 Missing :warning:
...impl/web/WebClientUrlForAuthenticationRetriever.kt 0.00% 20 Missing :warning:
...nfirmaccountprovider/ConfirmAccountProviderView.kt 25.00% 8 Missing and 1 partial :warning:
...creens/createaccount/MobileRegistrationResponse.kt 20.00% 4 Missing :warning:
...es/login/impl/resolver/network/ElementWellKnown.kt 0.00% 2 Missing :warning:
...pl/screens/createaccount/CreateAccountPresenter.kt 93.93% 1 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #3467 +/- ## =========================================== - Coverage 82.63% 82.52% -0.11% =========================================== Files 1701 1713 +12 Lines 40047 40275 +228 Branches 4872 4899 +27 =========================================== + Hits 33092 33237 +145 - Misses 5234 5314 +80 - Partials 1721 1724 +3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

jmartinesp commented 2 months ago

Just to double check, do we want to merge it with creation enabled while m.org can't create new users without the workaround?

bmarty commented 2 months ago

Just to double check, do we want to merge it with creation enabled while m.org can't create new users without the workaround?

I guess this is fine. If matrix.org is not ready, this error will be displayed:

image

So this is correct :)

iOS PR has been merged FWIW

sonarcloud[bot] commented 2 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud