Skip to content
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

The accessToken property is missing in the User interface #8209

Closed
NicolasPlanas1998 opened this issue Apr 27, 2024 · 1 comment
Closed

The accessToken property is missing in the User interface #8209

NicolasPlanas1998 opened this issue Apr 27, 2024 · 1 comment

Comments

@NicolasPlanas1998
Copy link

Operating System

iOS 16.4

Browser Version

Google Chrome 124.0.6367.79

Firebase SDK Version

10.11.1

Firebase SDK Product:

Auth

Describe your project's tooling

React App with Typescript

Describe the problem

The accessToken property is present in the User obj but is missing from the User interface and also the documentation

Steps and code to reproduce issue

  signInWithEmailAndPassword(auth, email, password).then((res) => {
      const token = res.user.accessToken;
    });

Error : Property 'accessToken' does not exist on type 'User'.ts(2339)

@NicolasPlanas1998 NicolasPlanas1998 added new A new issue that hasn't be categoirzed as question, bug or feature request question labels Apr 27, 2024
@jbalidiong jbalidiong added needs-attention and removed new A new issue that hasn't be categoirzed as question, bug or feature request labels Apr 29, 2024
@jbalidiong
Copy link
Contributor

Hi @NicolasPlanas1998, thanks for bringing this to our attention. I found a similar issue about this and I recommend following the suggestion of one of our engineers on how to retrieve the accessToken:

There are 3 tokens at play here:

  • The Firebase ID token (publicly exposed via user.getIdToken()).
  • The Firebase refresh token (not exposed to client code via interface, and won't ever be made easily accessible)
  • OAuth providers' accessToken field. This is provided by the OAuth credential itself but is not stored on the User object

I'll be closing this issue now. If you encounter another issue, feel free to create a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants