GodotNuts / GodotFirebase

Implementations of Firebase for Godot using GDScript
MIT License
532 stars 76 forks source link

New manual google auth function not exchanging successfully #210

Closed macktns closed 3 years ago

macktns commented 3 years ago

Describe the bug The new get_google_auth_manual does not work in my project and no errors are shown. Replacing auth.gd with a previous version works when calling get_google_auth.

To Reproduce Steps to reproduce the behavior: I created a brand new project and installed the current version of this plugin. I use Firebase.Auth.get_google_auth_manual() which redirects me to the browser okay. I then call Firebase.Auth.login_with_oauth(oath_token) and nothing happens. This happens because the token is not being exchanged successfully. _exchange_google_token comes back false so the request is never made.

Expected behavior Replacing auth.gd with a version that has the original get_google_auth allows me to login without problem.

Environment:

Additional context I do not have measurementId or domainUriPrefix setup, but I don't think that matters.

WolfgangSenff commented 3 years ago

I believe the workflow changed for that particular path. See here for a discussion that may help: https://github.com/GodotNuts/GodotFirebase/issues/207#issuecomment-864102021 I'll leave this open in case there's any other issue after you've finished, but I think the above might fix it for you. There's also some more info in #205 .

macktns commented 3 years ago

The function I would like to use is Get_google_auth_manual which is just a renamed version of get_google_auth. I don't think the work flow has changed for that function but I could be wrong. The new workflows and the linked discussions are for the new get_google_auth_redirect and get_google_auth_localhost. I still prefer the manual copy paste because being automatically redirected to an error page with localhost is confusing for someone that doesn't know what happened in the background. Also I mixed up a couple function names in my original post but have fixed it. The old auth.gd works. The new get_google_auth_manual results in a failure to exchange the token.

fenix-hub commented 3 years ago

@macktns Hi, Now you should be able to use the manual function back again. The automatic method changed the exchange function a little bit, so the process stopped just right there as you noticed.

Firebase.Auth.get_google_auth_manual()
Firebase.Auth.login_with_oauth(token)
macktns commented 3 years ago

Thank you!!