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

Verifying id token #77

Open
bsansone opened this issue Feb 16, 2022 · 0 comments
Open

Verifying id token #77

bsansone opened this issue Feb 16, 2022 · 0 comments

Comments

@bsansone
Copy link

I was following the example here https://github.com/dmurvihill/firebase-mock/blob/master/tutorials/admin/tokens.md and it looks like you are mocking the generation of the id token which returns just a random string:

this._idtoken = Math.random().toString();

once the token is retrieved from the user you call:

function serverLogic(token) {
  firebase.auth().verifyIdToken(token).then(function(user) {
    // do something with the user
    console.log(user.uid);
  });
}

but based on the docs the serverLogic method is not using the mock verifyIdToken method, is that intentional? I ask because if you are not using the mock version of verifyIdToken that Math.random() string will fail to be decoded by the actual firebase auth package.

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

No branches or pull requests

1 participant