Skip to content

Crash, when is trying to sign up with Apple or Google providers #133

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
yura-hb opened this issue Sep 10, 2023 · 4 comments · Fixed by #145
Closed

Crash, when is trying to sign up with Apple or Google providers #133

yura-hb opened this issue Sep 10, 2023 · 4 comments · Fixed by #145
Labels
waiting for customer response Issue is on hold awaiting more information from OP

Comments

@yura-hb
Copy link

yura-hb commented Sep 10, 2023

Hi,

I'm experiencing a crash when a new user is created via the Apple or Google provider for the @identity_fn.before_user_created() trigger. The stack trace is as follows:

Screenshot 2023-09-10 at 13 35 11

User authentication is done using firebase-ios-sdk and the source code is the following

try await auth.signIn(with: credential.credential)

I'm using Python 3.11 and firebase functions version 0.11.0. Could you please check the problem?

Best regards,
Yury Hayeu

@exaby73
Copy link
Contributor

exaby73 commented Sep 11, 2023

Hello @yura-hb. Python is throwing a KeyError which means that the email_verified key does not exist in token_data. Could you confirm this by logging out the contents of token_data?

@exaby73 exaby73 added the waiting for customer response Issue is on hold awaiting more information from OP label Sep 11, 2023
@yura-hb
Copy link
Author

yura-hb commented Sep 11, 2023

Hi, yes it is missing

Screenshot 2023-09-11 at 19 50 53

@exaby73
Copy link
Contributor

exaby73 commented Sep 17, 2023

Could you provide sample code of the function you're running?

@yura-hb
Copy link
Author

yura-hb commented Sep 19, 2023

Hi, it wouldn't even get to the function call, so this should suffice

@identity_fn.before_user_created(id_token=True)
def prepare_user_data(event: identity_fn.AuthBlockingEvent) -> identity_fn.BeforeCreateResponse | None:
   user = event.data
   uid = user.uid
   
   return identity_fn.BeforeCreateResponse()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for customer response Issue is on hold awaiting more information from OP
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants