Improve existing APIs
This commit is contained in:
parent
abb9959789
commit
175bada0df
7 changed files with 140 additions and 14 deletions
|
|
@ -22,17 +22,27 @@ import io.element.android.libraries.matrix.api.encryption.IdentityPasswordResetH
|
|||
|
||||
class FakeIdentityOidcResetHandle(
|
||||
override val url: String = "",
|
||||
var resetOidcLambda: () -> Result<Unit> = { error("Not implemented") }
|
||||
var resetOidcLambda: () -> Result<Unit> = { error("Not implemented") },
|
||||
var cancelLambda: () -> Unit = { error("Not implemented") },
|
||||
) : IdentityOidcResetHandle {
|
||||
override suspend fun resetOidc(): Result<Unit> {
|
||||
return resetOidcLambda()
|
||||
}
|
||||
|
||||
override suspend fun cancel() {
|
||||
cancelLambda()
|
||||
}
|
||||
}
|
||||
|
||||
class FakeIdentityPasswordResetHandle(
|
||||
var resetPasswordLambda: (UserId, String) -> Result<Unit> = { _, _ -> error("Not implemented") }
|
||||
var resetPasswordLambda: (UserId, String) -> Result<Unit> = { _, _ -> error("Not implemented") },
|
||||
var cancelLambda: () -> Unit = { error("Not implemented") },
|
||||
) : IdentityPasswordResetHandle {
|
||||
override suspend fun resetPassword(userId: UserId, password: String): Result<Unit> {
|
||||
return resetPasswordLambda(userId, password)
|
||||
}
|
||||
|
||||
override suspend fun cancel() {
|
||||
cancelLambda()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue