I need to authenticate the user using typescript in cloud function, Where i will be sending the users data (i.e email and password) as request body to the function, In function i need to authenticate the user using firebase and based on response i will be sending to the user.
Example
export const authenticate= functions.https.onRequest(async (request, response) => {
   //I need to authenticate the user with email and password to get 
    the UID of the user, but i don't know how to authenticate the 
    user using firebase
    response.send("{
     UID : "FIREBASE UID"
  }");
}).catch(error => {
console.log(error)
    response.send("{
     error :SIGNIN FAILED
}");
});
Can anyone help me out with this ?
