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 {
session.cryptoService().crossSigningService().initializeCrossSigning(
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
if (flow.nextUncompletedStage() == LoginFlowTypes.PASSWORD
&& errorCode == null
if (flowResponse.nextUncompletedStage() == LoginFlowTypes.PASSWORD
&& errCode == null
&& reAuthHelper.data != null) {
promise.resume(
UserPasswordAuth(
session = flow.session,
session = flowResponse.session,
user = session.myUserId,
password = reAuthHelper.data
)

View file

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

View file

@ -334,9 +334,9 @@ class DevicesViewModel @AssistedInject constructor(
try {
awaitCallback<Unit> {
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")
if (flow.nextUncompletedStage() == LoginFlowTypes.PASSWORD && reAuthHelper.data != null && errorCode == null) {
if (flowResponse.nextUncompletedStage() == LoginFlowTypes.PASSWORD && reAuthHelper.data != null && errCode == null) {
UserPasswordAuth(
session = null,
user = session.myUserId,
@ -344,8 +344,8 @@ class DevicesViewModel @AssistedInject constructor(
).let { promise.resume(it) }
} else {
Timber.d("## UIA : deleteDevice UIA > start reauth activity")
_viewEvents.post(DevicesViewEvents.RequestReAuth(flow, errorCode))
pendingAuth = DefaultBaseAuth(session = flow.session)
_viewEvents.post(DevicesViewEvents.RequestReAuth(flowResponse, errCode))
pendingAuth = DefaultBaseAuth(session = flowResponse.session)
uiaContinuation = promise
}
}