Added missing auth id field in third party account login form

This commit is contained in:
Sylvain Berfini 2024-08-07 17:18:01 +02:00
parent 455db9b9eb
commit 57f3b0c78b
4 changed files with 39 additions and 2 deletions

View file

@ -47,6 +47,8 @@ class ThirdPartySipAccountLoginViewModel @UiThread constructor() : GenericViewMo
val username = MutableLiveData<String>()
val authId = MutableLiveData<String>()
val password = MutableLiveData<String>()
val domain = MutableLiveData<String>()
@ -151,6 +153,7 @@ class ThirdPartySipAccountLoginViewModel @UiThread constructor() : GenericViewMo
// Allow to enter SIP identity instead of simply username
// in case identity domain doesn't match proxy domain
val user = username.value.orEmpty().trim()
val userId = authId.value.orEmpty().trim()
val identity = if (user.startsWith("sip:")) {
if (user.contains("@")) {
user
@ -168,7 +171,7 @@ class ThirdPartySipAccountLoginViewModel @UiThread constructor() : GenericViewMo
newlyCreatedAuthInfo = Factory.instance().createAuthInfo(
user,
null,
userId,
password.value.orEmpty().trim(),
null,
null,

View file

@ -94,6 +94,38 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/authentication_id_label"
style="@style/header_style"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:text="@string/authentication_id"
app:layout_constraintTop_toBottomOf="@id/username"
app:layout_constraintStart_toStartOf="@id/authentication_id"/>
<androidx.appcompat.widget.AppCompatEditText
style="@style/default_text_style"
android:id="@+id/authentication_id"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:text="@={viewModel.authId}"
android:textSize="14sp"
android:textColor="?attr/color_main2_600"
android:background="@drawable/edit_text_background"
android:inputType="text"
android:hint="@string/authentication_id"
app:layout_constraintWidth_max="@dimen/text_input_max_width"
app:layout_constraintTop_toBottomOf="@id/authentication_id_label"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/password_label"
style="@style/header_style"
@ -103,7 +135,7 @@
android:layout_marginEnd="16dp"
android:layout_marginTop="16dp"
android:text="@string/password"
app:layout_constraintTop_toBottomOf="@id/username"
app:layout_constraintTop_toBottomOf="@id/authentication_id"
app:layout_constraintStart_toStartOf="@id/password"/>
<androidx.appcompat.widget.AppCompatEditText

View file

@ -11,6 +11,7 @@
<string name="sip_address_display_name">Nom d\'affichage</string>
<string name="sip_address_domain">Domaine</string>
<string name="username">Nom d\'utilisateur</string>
<string name="authentication_id">Identifiant de connexion (si différent)</string>
<string name="password">Mot de passe</string>
<string name="phone_number">Numéro de téléphone</string>
<string name="or">ou</string>

View file

@ -47,6 +47,7 @@
<string name="sip_address_display_name">Display name</string>
<string name="sip_address_domain">Domain</string>
<string name="username">Username</string>
<string name="authentication_id">Authentication ID (if different)</string>
<string name="password">Password</string>
<string name="phone_number">Phone number</string>
<string name="or">or</string>