#[SOLVED] Flutter web Oauth2 cannot return to the previous interface

21 messages · Page 1 of 1 (latest)

iron dagger
#

Flutter web uses Appwrite Oauth2 authorization to set the success callback to automatically open the new Flutter web app and cannot return to the previous interface

iron dagger
iron dagger
#

I tested the authorization login of github locally. After it was successfully released, the authorization error was as follows

#

Error 500
Duplicated document: Duplicate entry 'ip:113.118.169.94-2023-09-06 00:00:00.000' for key '_32814_abuse.unique1'
Error ID: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

lean kraken
#

This only happens if you're hitting some endpoint too fast 🧐. Is this happening regularly? What endpoint is this occurring on?

iron dagger
#

I didn't click either. It will be normal soon. Authorize and log in.

#

But the latest error report has changed

#

Invalid success: URL host must be one of: localhost, cloud.appwrite.io
Error ID: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

#

final account = Account(client);
var host = 'http://localhost:53137';
if (kReleaseMode) {
host = 'https://winnerapp.github.io';
}

try {
  await account.createOAuth2Session(
    provider: 'github',
    success: '$host/auth.html',
  );
  final user = await account.get();
  final userPrefs = await account.getPrefs();
  global.userR.value = user;
  Get.back();
}
#
 final account = Account(client);
    var host = 'http://localhost:53137';
    if (kReleaseMode) {
      host = 'https://winnerapp.github.io';
    }

    try {
      await account.createOAuth2Session(
        provider: 'github',
        success: '$host/auth.html',
      );
      final user = await account.get();
      final userPrefs = await account.getPrefs();
      global.userR.value = user;
      Get.back();
    }
lean kraken
iron dagger
#

But I wrote it based on Flutter Web, not a real web platform

iron dagger
#

You mean, although I use flutter web, I still need to register the web platform to use it, right? Not the flutter platform.

iron dagger
#

Ok, I'll give it a try.

#

Thank you, I added the web platform to solve my error reporting problem.

spark crystal
#

Hey @iron dagger is tyour problem solved?

iron dagger
#

YES