
I am using the Gitlab OAuth2 Provider to do the authentication and it worked perfectly in iOS and Android. However, when I run the application in Web mode. I get stuck on the callback page (see first screenshot).
According to https://appwrite.io/docs/getting-started-for-flutter#web I added the web/auth.html And adapted my call
await _account.createOAuth2Session(
provider: 'gitlab',
success: 'http://localhost:8000/auth.html',
failure: 'http://localhost:8000/',
);
Now the web works, but the iOS and Android get stuck (see second screenshot).
What am I doing wrong 🙂

you'll need to have a condition to pass the auth.html only if the platform is web. you can use the kIsWeb
constant.

well that was the fastest help i ever got, thx a lot @Steven ❤️

happy to help! <:appwritepeepo:902865250427215882>

[SOLVED] Flutter Web OAuth

Hi @zwaragharrys can i have a question. Did you run flutter with specific port 8000?

yes, I'm using vscode
you can create a file .vscode/launch.json
with the following code. This allows you to run the application with a fixed port.
{
"version": "0.2.0",
"configurations": [
{
"name": "Flutterome",
"request": "launch",
"type": "dart",
"args": [
"-d",
"chrome",
"--web-port",
"8000"
],
}
]
}

Ok. Thanks for your answer!

Ak. If you have resolved with how to check if platform is web or and or ios, can you share me your code? Tks a lot!

It would be something like this:
await _account.createOAuth2Session(
provider: 'gitlab',
success: kIsWeb ? null : 'http://localhost:8000/auth.html'
);
Recommended threads
- Stuck at pinging the server to finish ad...
I'm not using the starter app and I'm not sure how to finish connecting my app to Appwrite.io. Is there a CURL command I can run to finish setup?
- Error getting session: AppwriteException...
I get this error `Error getting session: AppwriteException: User (role: guests) missing scope (account)` when running in prod. As soon as I try running my app o...
- Trouble with emailVerification(appname:/...
[AppwriteException: Invalid `url` param: Invalid URI. Register your new client (app) as a new platform on your project console dashboard]. i previously had ema...
