I build a tiny little App that lets you login with your Google or Discord Account and greets you with your username if logged in. Code is here: https://github.com/theLazyPragmatic/oauthtest
so, I haven't figured out Riverpod yet, so you have to reload the app in order to see the greeting. This issue is not about that (although I am more than happy if someone shows me whats wrong). BUT: Redirecting from google signin does work as expected, redirecting from discord does not. Both providers received the same redirect-uri from the appwrite console during setup. Discord also creates a user / a session in appwrite - after authorizing, the browser gets briefly redirected to cloud.appwrite.io, but then immediately back to discord.
@D5 thanks for looking into it.
After redirect, you can route. You don't need to use riverpod
Just material route
...But I want to use riverpod and I don't want a new route, I want this page to be rebuilt. Routing back to the page after login/logout feels like a clever hack, but a cheat nontheless.. (and it does not work...)
The core problem, however, is that - for Discord - there is no redirect. Browser: Discord.com -> "Authorize" -> cloud.appwrite.io -> Discord.com -> "Authorize" etc. At least google redirects back (but does not rebuild page.)
After the GetX experience, I recommend sticking to native/flutter parts if possible. Using riverpod for displaying data is great and I do that. However in your case, you should route after login to a different page instead of changing/hiding the existing widget
Hmm I think all the ouath providers redirect back to the app, right?
Docs say they should. MyApp says they don't.
But only for Discord? Google returns back to the app?
Yes.
Recommended threads
- Anonymous Sessions using Node SDKs
I am attempting to use anonymous sessions with the Node SDK but I have simply no idea how to persist the session to a cookie, pass it to the session client, etc...
- Auth working for emulator but not for ph...
hey guys i'm using appwrite for expo react native it is working perfectly for emulator but does not working for physical devices can u explain any one and it is...
- unlike any other provider, your sites DN...
your nameservers dont work with a funny little CNAME error, which is a weird bug but thats what you get when you try to be the kitchen sink, funny errors.