Skip to content

displayName not set in Firebase user auth.create trigger with Apple sign in #855

@ottob

Description

@ottob

Related issues

#95 but that is another provider. I tried the workaround posted there. Calling firebase auth from the trigger to get the user.

let user = await admin.auth().getUser(userRecord.uid);
user = user.toJSON();
// user.displayName is valid while userRecord.displayName is undefined.

but displayName is empty there also.

[REQUIRED] Version info

node: v14.15.4

firebase-functions: 3.13.1

firebase-tools: 9.3.0

firebase-admin: 9.4.2

[REQUIRED] Test case

exports.saveUser = functions.auth.user().onCreate((user) => {
  console.log('user displayName', user.displayName)
})

[REQUIRED] Steps to reproduce

  1. Sign in with Apple with a new user (in react native iOS app). Make sure that the name is shared from the Sign in with Apple prompt.
  2. Notice the trigger being run when the user is created.

[REQUIRED] Expected behavior

To see the name of the user. The displayName is set when using Facebook or Google providers with Firebase Auth, but not when using the Apple provider.

[REQUIRED] Actual behavior

displayName is empty.

Were you able to successfully deploy your functions?

Yes

Im sorry if this is the wrong place to report this issue. But there are many moving parts involved and its hard to say where the problem is:

firebase-functions
firebase-tools
firebase-admin
https://github.com/invertase/react-native-apple-authentication
https://github.com/invertase/react-native-firebase/tree/master/packages/auth

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions