Back

Flutter, Riverpod, OAuth2.

  • 0
  • Flutter
  • Auth
  • Cloud
theLazyPragmatic
22 Jan, 2025, 12:00

So I was trying to learn something new and productive and at the same time wanted to learn it with future perspective. So Flutter, but with appwrite. I mostly followed https://www.youtube.com/watch?v=XnxZLhtkFeg (skipping only the self hosted part in favour of cloud) and got email signup, login and saving users to DB to work. Next I wanted to add signup via discord and figured, that would work a lot like login, but with the added user creation if none existed with the given id. here's the function in the controller and the function in the api. I also added the snippet in the manifest.

When I click the button, a browser opens on discord.com and wants me to authorize the app, then shortly visits cloud.appwrite.io, then goes back to discord "Authorize". When I manually switch back to the app the debug-console says

TypeScript
W/OpenGLRenderer( 3609): Failed to initialize 101010-2 format, error = EGL_SUCCESS
E/OpenGLRenderer( 3609): Unable to match the desired swap behavior.```

the AuthUser gets created in appwrite console, as does a session, but the app won't navigate to home. 

As a second issue, I tried to run the app in web, too, but I believe the success & failure urls aren't optional in this case. passing "http:localhost" does not work here, but I cannot figure out which other url to provide here.
TL;DR
Developers having issues with implementing OAuth2 in a Flutter app using Riverpod and Appwrite. Trying to add Discord signup functionality but encountering navigation problems and console errors. Also facing issues running the app on the web due to required success and failure URLs.
theLazyPragmatic
22 Jan, 2025, 12:03

I am, as stated, quite the beginner with flutter, auth and basically all of this & I can only allocate limited leisuretime to try and understand this. So apologies for my glacial learningprowess, and thanks in advance @D5 (and everyone else) to look into this.

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more