-
Notifications
You must be signed in to change notification settings - Fork 87
Recover user auth #479
-
Heya, I'm currently working on a turn based game and i'm using firebase for my BE so I came across this plugin :D
I'm very lost in regards to how the auth is supposed to work. Is anonymous auth required for this plugin to work ? User can only access the app if logged in so I don't really want anonymous login functionality (especially since a new entry is created everytime, after a couple day of development I already have 500 anon users from this).
Having disabled login_anonymous in firebase, my requests started failing because user wasn't authenticated so I started to look into how to get that. From digging around the code, I kinda seemed that Firebase.Auth.check_auth_file (load_auth by proxy) would login the user if auth existed, but that was clearly not happening, so I figured I would have to it manually. So I updated my code to: if auth file exists, then manually call login_with_oauth, but now I'm running into app crashes because of exchange_token(): HTTPRequest is processing a request. Wait for completion or cancel it before attempting a new one errors(and the respective stdout log,[Firebase Error] >> Error exchanging tokens: 44`)
I've a splash scene to handle some initial setup / loadings, one of which is to check user auth, which is as follows:
func check_auth() -> void: if Firebase.Auth.check_auth_file(): await Firebase.Auth.login_with_oauth(Firebase.Auth.auth.idtoken, Firebase.Auth.get_GoogleProvider()) GameState.set_user(await User.from_local(Firebase.Auth.auth.email)) is_authed = true
Nothing really happening before this function is called and it fails at the login_with_oauth so doesn't seem to be any of my code messing it up xD
Any guidance would be great
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 2 comments 2 replies
-
It's a complicated process. I'll make a video today that will help and post it. I'll message here again with the link when I've done so.
Beta Was this translation helpful? Give feedback.
All reactions
-
okii, thanks.
Any ETA on when you'll find the time ? Just so I can organize my planing :p
Beta Was this translation helpful? Give feedback.
All reactions
-
Sorry, I'm working on it! I hope to finish it soon, maybe today or this weekend.
Beta Was this translation helpful? Give feedback.
All reactions
-
no worries ^^
Beta Was this translation helpful? Give feedback.