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

Add initial device name to get login flow

parent 2c1a1fea
No related branches found
No related tags found
No related merge requests found
......@@ -81,7 +81,7 @@ interface LoginWizard {
suspend fun resetPasswordMailConfirmed(newPassword: String, logoutAllDevices: Boolean = true)
//Added to support few login flows
suspend fun getAllLoginFlows(identifier: JsonDict): List<List<Stage>>
suspend fun getAllLoginFlows(identifier: JsonDict, initialDeviceName: String? = null): List<List<Stage>>
/**
* Perform custom login stage by sending a custom JsonDict.
......
......@@ -148,9 +148,9 @@ internal class DefaultLoginWizard(
}
//Added to support few login flows
override suspend fun getAllLoginFlows(identifier: JsonDict): List<List<Stage>> {
override suspend fun getAllLoginFlows(identifier: JsonDict, initialDeviceName: String?): List<List<Stage>> {
try {
loginFlowTask.execute(LoginFlowTask.Params(LoginFlowParams(identifier = identifier)))
loginFlowTask.execute(LoginFlowTask.Params(LoginFlowParams(identifier = identifier, initialDeviceDisplayName = initialDeviceName)))
} catch (exception: Throwable) {
return if (exception is Failure.RegistrationFlowError) {
pendingSessionData =
......@@ -184,10 +184,10 @@ internal class DefaultLoginWizard(
mutableParams["session"] = safeSession
val params = LoginFlowParams(auth = mutableParams, identifier = identifierParams, initialDeviceDisplayName = initialDeviceName)
return performRegistrationRequest(LoginType.CUSTOM, params)
return performLoginRequest(LoginType.CUSTOM, params)
}
private suspend fun performRegistrationRequest(
private suspend fun performLoginRequest(
loginType: LoginType,
loginParams: LoginFlowParams
): RegistrationResult {
......
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