Appwite 1.5 support

This commit is contained in:
Jake Barnby
2024-03-08 10:44:19 +01:00
parent 1001681968
commit 0468a1bab2
30 changed files with 372 additions and 170 deletions
@@ -9,7 +9,7 @@ Client client = new Client(context)
Account account = new Account(client);
account.addAuthenticator(
account.createMfaAuthenticator(
AuthenticatorType.TOTP, // type
new CoroutineCallback<>((result, error) -> {
if (error != null) {
@@ -9,8 +9,8 @@ Client client = new Client(context)
Account account = new Account(client);
account.createChallenge(
AuthenticationFactor.TOTP, // factor
account.createMfaChallenge(
AuthenticationFactor.EMAIL, // factor
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
@@ -0,0 +1,18 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Account;
Client client = new Client(context)
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2"); // Your project ID
Account account = new Account(client);
account.createMfaRecoveryCodes(new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}
Log.d("Appwrite", result.toString());
}));
@@ -9,7 +9,7 @@ Client client = new Client(context)
Account account = new Account(client);
account.verifyAuthenticator(
account.deleteMfaAuthenticator(
AuthenticatorType.TOTP, // type
"<OTP>", // otp
new CoroutineCallback<>((result, error) -> {
@@ -0,0 +1,18 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Account;
Client client = new Client(context)
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2"); // Your project ID
Account account = new Account(client);
account.getMfaRecoveryCodes(new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}
Log.d("Appwrite", result.toString());
}));
@@ -8,7 +8,7 @@ Client client = new Client(context)
Account account = new Account(client);
account.listFactors(new CoroutineCallback<>((result, error) -> {
account.listMfaFactors(new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
@@ -9,7 +9,7 @@ Client client = new Client(context)
Account account = new Account(client);
account.deleteAuthenticator(
account.updateMfaAuthenticator(
AuthenticatorType.TOTP, // type
"<OTP>", // otp
new CoroutineCallback<>((result, error) -> {
@@ -8,7 +8,7 @@ Client client = new Client(context)
Account account = new Account(client);
account.updateChallenge(
account.updateMfaChallenge(
"<CHALLENGE_ID>", // challengeId
"<OTP>", // otp
new CoroutineCallback<>((result, error) -> {
@@ -0,0 +1,18 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Account;
Client client = new Client(context)
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2"); // Your project ID
Account account = new Account(client);
account.updateMfaRecoveryCodes(new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}
Log.d("Appwrite", result.toString());
}));
@@ -9,6 +9,6 @@ val client = Client(context)
val account = Account(client)
val result = account.addAuthenticator(
val result = account.createMfaAuthenticator(
type = AuthenticatorType.TOTP,
)
@@ -9,6 +9,6 @@ val client = Client(context)
val account = Account(client)
val result = account.createChallenge(
factor = AuthenticationFactor.TOTP,
val result = account.createMfaChallenge(
factor = AuthenticationFactor.EMAIL,
)
@@ -0,0 +1,11 @@
import io.appwrite.Client
import io.appwrite.coroutines.CoroutineCallback
import io.appwrite.services.Account
val client = Client(context)
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
val account = Account(client)
val result = account.createMfaRecoveryCodes()
@@ -9,7 +9,7 @@ val client = Client(context)
val account = Account(client)
val result = account.verifyAuthenticator(
val result = account.deleteMfaAuthenticator(
type = AuthenticatorType.TOTP,
otp = "<OTP>",
)
@@ -0,0 +1,11 @@
import io.appwrite.Client
import io.appwrite.coroutines.CoroutineCallback
import io.appwrite.services.Account
val client = Client(context)
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
val account = Account(client)
val result = account.getMfaRecoveryCodes()
@@ -8,4 +8,4 @@ val client = Client(context)
val account = Account(client)
val result = account.listFactors()
val result = account.listMfaFactors()
@@ -9,7 +9,7 @@ val client = Client(context)
val account = Account(client)
val result = account.deleteAuthenticator(
val result = account.updateMfaAuthenticator(
type = AuthenticatorType.TOTP,
otp = "<OTP>",
)
@@ -8,7 +8,7 @@ val client = Client(context)
val account = Account(client)
val result = account.updateChallenge(
val result = account.updateMfaChallenge(
challengeId = "<CHALLENGE_ID>",
otp = "<OTP>",
)
@@ -0,0 +1,11 @@
import io.appwrite.Client
import io.appwrite.coroutines.CoroutineCallback
import io.appwrite.services.Account
val client = Client(context)
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
val account = Account(client)
val result = account.updateMfaRecoveryCodes()