HTTPS Callable cloud function auth check email address domain
cloud function auth email domain check
// Get email address from auth and check is @example.com email
const email = context.auth.token.email;
if(!email.endsWith('@example.com')){
throw new functions.https.HttpsError(
"failed-precondition",
"The function must be called " + "while authenticated with @example.com email address."
);
}Last updated
Was this helpful?