
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

did you do this? https://github.com/appwrite/sdk-for-flutter#web

Sorry, I misunderstood. I should design a successful callback address like host/auth.html instead of pointing to another path.

Yes

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

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

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();
}

You must add a web platform https://appwrite.io/docs/getting-started-for-web#addPlatform

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

You still need to register https://appwrite.io/docs/getting-started-for-flutter#web

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

Sure, yes

Ok, I'll give it a try.

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

Hey @joser is tyour problem solved?

YES

[SOLVED] Flutter web Oauth2 cannot return to the previous interface
Recommended threads
- Flutter OAuth2 Google does not return to...
When the flow starts, the browser opens, I select an account, and it keeps showing: """ Page not found The page you're looking for doesn't exist. `general_rout...
- Redirect URL sends HTTP instead of HTTPS...
I am not sure since when this issue is present, but my Google and Apple redirect URI are no longer pointing to the HTTPS redirect URI when I try to use OAuth. ...
- Failing to run document operations on sd...
Could someone point me in the right direction I'm going in cirlces. I have a problem with sdks and my self-hosted server in production (for ~3 years) I have bee...
