This commit is contained in:
Valere 2021-02-03 09:32:51 +01:00
parent 697b551b9b
commit 97daf57b0a
3 changed files with 12 additions and 12 deletions

View file

@ -215,14 +215,14 @@ class HomeActivityViewModel @AssistedInject constructor(
try { try {
session.cryptoService().crossSigningService().initializeCrossSigning( session.cryptoService().crossSigningService().initializeCrossSigning(
object : UserInteractiveAuthInterceptor { object : UserInteractiveAuthInterceptor {
override fun performStage(flow: RegistrationFlowResponse, errorCode: String?, promise: Continuation<UIABaseAuth>) { override fun performStage(flowResponse: RegistrationFlowResponse, errCode: String?, promise: Continuation<UIABaseAuth>) {
// We missed server grace period or it's not setup, see if we remember locally password // We missed server grace period or it's not setup, see if we remember locally password
if (flow.nextUncompletedStage() == LoginFlowTypes.PASSWORD if (flowResponse.nextUncompletedStage() == LoginFlowTypes.PASSWORD
&& errorCode == null && errCode == null
&& reAuthHelper.data != null) { && reAuthHelper.data != null) {
promise.resume( promise.resume(
UserPasswordAuth( UserPasswordAuth(
session = flow.session, session = flowResponse.session,
user = session.myUserId, user = session.myUserId,
password = reAuthHelper.data password = reAuthHelper.data
) )

View file

@ -98,9 +98,9 @@ class CrossSigningSettingsViewModel @AssistedInject constructor(
awaitCallback<Unit> { awaitCallback<Unit> {
session.cryptoService().crossSigningService().initializeCrossSigning( session.cryptoService().crossSigningService().initializeCrossSigning(
object : UserInteractiveAuthInterceptor { object : UserInteractiveAuthInterceptor {
override fun performStage(flow: RegistrationFlowResponse, errorCode: String?, promise: Continuation<UIABaseAuth>) { override fun performStage(flowResponse: RegistrationFlowResponse, errCode: String?, promise: Continuation<UIABaseAuth>) {
Timber.d("## UIA : initializeCrossSigning UIA") Timber.d("## UIA : initializeCrossSigning UIA")
if (flow.nextUncompletedStage() == LoginFlowTypes.PASSWORD && reAuthHelper.data != null && errorCode == null) { if (flowResponse.nextUncompletedStage() == LoginFlowTypes.PASSWORD && reAuthHelper.data != null && errCode == null) {
UserPasswordAuth( UserPasswordAuth(
session = null, session = null,
user = session.myUserId, user = session.myUserId,
@ -108,8 +108,8 @@ class CrossSigningSettingsViewModel @AssistedInject constructor(
).let { promise.resume(it) } ).let { promise.resume(it) }
} else { } else {
Timber.d("## UIA : initializeCrossSigning UIA > start reauth activity") Timber.d("## UIA : initializeCrossSigning UIA > start reauth activity")
_viewEvents.post(CrossSigningSettingsViewEvents.RequestReAuth(flow, errorCode)) _viewEvents.post(CrossSigningSettingsViewEvents.RequestReAuth(flowResponse, errCode))
pendingAuth = DefaultBaseAuth(session = flow.session) pendingAuth = DefaultBaseAuth(session = flowResponse.session)
uiaContinuation = promise uiaContinuation = promise
} }
} }

View file

@ -334,9 +334,9 @@ class DevicesViewModel @AssistedInject constructor(
try { try {
awaitCallback<Unit> { awaitCallback<Unit> {
session.cryptoService().deleteDevice(deviceId, object : UserInteractiveAuthInterceptor { session.cryptoService().deleteDevice(deviceId, object : UserInteractiveAuthInterceptor {
override fun performStage(flow: RegistrationFlowResponse, errorCode: String?, promise: Continuation<UIABaseAuth>) { override fun performStage(flowResponse: RegistrationFlowResponse, errCode: String?, promise: Continuation<UIABaseAuth>) {
Timber.d("## UIA : deleteDevice UIA") Timber.d("## UIA : deleteDevice UIA")
if (flow.nextUncompletedStage() == LoginFlowTypes.PASSWORD && reAuthHelper.data != null && errorCode == null) { if (flowResponse.nextUncompletedStage() == LoginFlowTypes.PASSWORD && reAuthHelper.data != null && errCode == null) {
UserPasswordAuth( UserPasswordAuth(
session = null, session = null,
user = session.myUserId, user = session.myUserId,
@ -344,8 +344,8 @@ class DevicesViewModel @AssistedInject constructor(
).let { promise.resume(it) } ).let { promise.resume(it) }
} else { } else {
Timber.d("## UIA : deleteDevice UIA > start reauth activity") Timber.d("## UIA : deleteDevice UIA > start reauth activity")
_viewEvents.post(DevicesViewEvents.RequestReAuth(flow, errorCode)) _viewEvents.post(DevicesViewEvents.RequestReAuth(flowResponse, errCode))
pendingAuth = DefaultBaseAuth(session = flow.session) pendingAuth = DefaultBaseAuth(session = flowResponse.session)
uiaContinuation = promise uiaContinuation = promise
} }
} }