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

[Question] How to setup a user that has their email verified #19

Closed
VictorUvarov opened this issue Aug 4, 2020 · 1 comment
Closed

Comments

@VictorUvarov
Copy link

Since a helper function for firestore.rules would look like

function emailVerified() {
  return request.auth.token.email_verified;
}

I assumed the setup with this quickstart would look like this

const bob = getAuthedFirestore({
  uid: "bob",
  token: { email_verified: true },
});

Any guidance would help very much.

@samtstern
Copy link
Contributor

@ViktorUvarov I recently submitted a change to @firebase/rules-unit-testing to make this a lot easier:
firebase/firebase-js-sdk#3876

Once the next release comes out (they usually happen weekly) you can do something like this:

const firebase = require('@firebase/rules-unit-testing`);

const app = firebase.initializeTestApp({
  projectId: 'foo',
  auth: {
    uid: "bob",
    email: "bob@example.com",
    email_verified: true
  }
);

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

2 participants