AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
Implement Redirect Authentication for Google and GitHub Sign-In (#5515)
hunteraraujo0d5c2a98c071
diff --git a/frontend/lib/services/auth_service.dart b/frontend/lib/services/auth_service.dartindex dac4db90b1..3cbb3b9c73 100644--- a/frontend/lib/services/auth_service.dart+++ b/frontend/lib/services/auth_service.dart@@ -7,31 +7,24 @@ class AuthService {clientId:"387936576242-iejdacrjljds7hf99q0p6eqna8rju3sb.apps.googleusercontent.com");- // Sign in with Google+// Sign in with Google using redirectFuture<UserCredential?> signInWithGoogle() async {try {- final GoogleSignInAccount? googleSignInAccount =- await googleSignIn.signIn();- if (googleSignInAccount != null) {- final GoogleSignInAuthentication googleSignInAuthentication =- await googleSignInAccount.authentication;- final AuthCredential credential = GoogleAuthProvider.credential(- accessToken: googleSignInAuthentication.accessToken,- idToken: googleSignInAuthentication.idToken,- );- return await _auth.signInWithCredential(credential);- }+ final GoogleAuthProvider googleProvider = GoogleAuthProvider();+ await _auth.signInWithRedirect(googleProvider);+ return await _auth.getRedirectResult();} catch (e) {print("Error during Google Sign-In: $e");return null;}}- // Sign in with GitHub+// Sign in with GitHub using redirectFuture<UserCredential?> signInWithGitHub() async {try {- final GithubAuthProvider provider = GithubAuthProvider();- return await _auth.signInWithPopup(provider);+ final GithubAuthProvider githubProvider = GithubAuthProvider();+ await _auth.signInWithRedirect(githubProvider);+ return await _auth.getRedirectResult();} catch (e) {print("Error during GitHub Sign-In: $e");return null;