import * as functions from "firebase-functions" ; import { CallableContext } from "firebase-functions/lib/providers/https" ; export default class Authenticator { async authenticate ( data , context ) { if ( ! context . auth ) { throw new functions . https . HttpsError ( 'unauthenticated' , 'The function must be called while authenticated.' ) ; } return context . auth ?. uid ; } }