Error : 'Credential implementation provided to initializeApp() via the "credential" property failed to fetch a valid Google OAuth2 access token with the following error: "Error fetching access token: Error while making request: .".' #2629
Labels
[REQUIRED] Step 2: Describe your environment
[REQUIRED] Step 3: Describe the problem
Facing this error:
'Credential implementation provided to initializeApp() via the "credential" property failed to fetch a valid Google OAuth2 access token with the following error: "Error fetching access token: Error while making request: .".'
I set env also when I check it from console.log I got service account file values as object but still face this error when it hit that post request I got this error
Relevant Code:
that's my code:
const admin =require ('firebase-admin')
const { getAuth } = require('firebase-admin/auth');
try {
admin.initializeApp()
} catch (error) {
console.log(error)
}
app.post('/api/auth/signup',async(req,res)=>{
try {
const {email,password,username} = req.body;
const user = await getAuth().createUser({
email,
password,
})
}
catch(error){
console.log(error
}
}
The text was updated successfully, but these errors were encountered: