From 68cd06f1fb84217d04efcd4885456aedeeda4c9b Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 17 Dec 2020 11:15:19 +0100 Subject: [PATCH] Improve redirect url, which can be visible to the user: "element://element" -> "element://connect" --- docs/signin.md | 4 ++-- vector/src/main/AndroidManifest.xml | 5 +++-- .../main/java/im/vector/app/features/login/LoginViewState.kt | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/signin.md b/docs/signin.md index 06f715c46b..0a234d2a20 100644 --- a/docs/signin.md +++ b/docs/signin.md @@ -165,7 +165,7 @@ In this case, the user can click on "Sign in with SSO" and the native web browse > https://homeserver.with.sso/_matrix/client/r0/login/sso/redirect?redirectUrl=element%3A%2F%element -The parameter `redirectUrl` is set to `element://element`. +The parameter `redirectUrl` is set to `element://connect`. ChromeCustomTabs are an intermediate way to display a WebPage, between a WebView and using the external browser. More info can be found [here](https://developer.chrome.com/multidevice/android/customtabs) @@ -175,7 +175,7 @@ During the process, user may be asked to validate an email by clicking on a link Once the process is finished, the web page will call the `redirectUrl` with an extra parameter `loginToken` -> element://element?loginToken=MDAxOWxvY2F0aW9uIG1vemlsbGEub3JnCjAwMTNpZGVudGlmaWVy +> element://connect?loginToken=MDAxOWxvY2F0aW9uIG1vemlsbGEub3JnCjAwMTNpZGVudGlmaWVy This navigation is intercepted by Element by the `LoginActivity`, which will then ask the homeserver to convert this `loginToken` to an access token diff --git a/vector/src/main/AndroidManifest.xml b/vector/src/main/AndroidManifest.xml index bf839b807c..4ad51fdea7 100644 --- a/vector/src/main/AndroidManifest.xml +++ b/vector/src/main/AndroidManifest.xml @@ -95,8 +95,9 @@ - - + diff --git a/vector/src/main/java/im/vector/app/features/login/LoginViewState.kt b/vector/src/main/java/im/vector/app/features/login/LoginViewState.kt index e444844022..5254abf1d9 100644 --- a/vector/src/main/java/im/vector/app/features/login/LoginViewState.kt +++ b/vector/src/main/java/im/vector/app/features/login/LoginViewState.kt @@ -90,6 +90,6 @@ data class LoginViewState( companion object { // Note that the domain can be displayed to the user for confirmation that he trusts it. So use a human readable string - private const val VECTOR_REDIRECT_URL = "element://element" + private const val VECTOR_REDIRECT_URL = "element://connect" } }