Skip to content
Snippets Groups Projects
Commit 90b3c204 authored by Taras's avatar Taras
Browse files

Add initialDeviceDisplayName to login stage

parent a08d21b6
No related branches found
No related tags found
No related merge requests found
...@@ -88,5 +88,5 @@ interface LoginWizard { ...@@ -88,5 +88,5 @@ interface LoginWizard {
* Current login "session" param will be included into authParams by default. * Current login "session" param will be included into authParams by default.
* The authParams should contain at least one entry "type" with a String value. * The authParams should contain at least one entry "type" with a String value.
*/ */
suspend fun loginStageCustom(authParams: JsonDict, identifierParams: JsonDict? = null): RegistrationResult suspend fun loginStageCustom(authParams: JsonDict, identifierParams: JsonDict? = null, initialDeviceName: String? = null): RegistrationResult
} }
...@@ -174,7 +174,8 @@ internal class DefaultLoginWizard( ...@@ -174,7 +174,8 @@ internal class DefaultLoginWizard(
//Added to support few login flows //Added to support few login flows
override suspend fun loginStageCustom( override suspend fun loginStageCustom(
authParams: JsonDict, authParams: JsonDict,
identifierParams: JsonDict? identifierParams: JsonDict?,
initialDeviceName: String?
): RegistrationResult { ): RegistrationResult {
val safeSession = pendingSessionData.currentSession val safeSession = pendingSessionData.currentSession
?: throw IllegalStateException("developer error, call createAccount() method first") ?: throw IllegalStateException("developer error, call createAccount() method first")
...@@ -182,7 +183,7 @@ internal class DefaultLoginWizard( ...@@ -182,7 +183,7 @@ internal class DefaultLoginWizard(
val mutableParams = authParams.toMutableMap() val mutableParams = authParams.toMutableMap()
mutableParams["session"] = safeSession mutableParams["session"] = safeSession
val params = LoginFlowParams(auth = mutableParams, identifier = identifierParams) val params = LoginFlowParams(auth = mutableParams, identifier = identifierParams, initialDeviceDisplayName = initialDeviceName)
return performRegistrationRequest(LoginType.CUSTOM, params) return performRegistrationRequest(LoginType.CUSTOM, params)
} }
......
...@@ -30,5 +30,9 @@ internal data class LoginFlowParams( ...@@ -30,5 +30,9 @@ internal data class LoginFlowParams(
val auth: JsonDict? = null, val auth: JsonDict? = null,
@Json(name = "identifier") @Json(name = "identifier")
val identifier: JsonDict? = null val identifier: JsonDict? = null,
// device name
@Json(name = "initial_device_display_name")
val initialDeviceDisplayName: String? = null
) )
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment