Have deployed a few firebase functions (according to docs)
firebase init
Changed the code to something like
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp();
exports.getUsers = functions
.region('europe-west1')
.https.onRequest((req, res) => {
admin.firestore().collection('users').get().then(data => {
const users = data.map(user => user.data());
return res.json(users);
}).catch(err => console.error(err));
});
exports.helloWorld = functions.https.onRequest((req, res) => {
res.status(200).send('Hello, World!');
});
Deployed it.
firebase deploy
And as an end result both of the functions return
Error: Forbidden Your client does not have permission to get URL /getUsers from this server.
Error: Forbidden Your client does not have permission to get URL /helloWorld from this server.
In the firebase admin console I see that functions exist, and they are there, and I am using same exact urls that the terminal gave me & are on the firebase admin console.
Any ideas?
PS. Located in Estonia.