Skip to content

Commit

Permalink
messed arounf with settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Xoann committed Oct 27, 2023
1 parent 0ed7712 commit 8f150f5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
15 changes: 11 additions & 4 deletions firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,17 @@
},
"hosting": {
"public": "public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"headers": [
{
"source": "**",
"headers": [
{
"key": "Access-Control-Allow-Origin",
"value": "https://recipebook2-a9e9a.web.app"
}
]
}
]
},
"storage": {
Expand Down
3 changes: 2 additions & 1 deletion public/scripts/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,8 @@ function createForkBtn(database, recipeDiv, recipe, profile) {
recipeDiv.appendChild(forkBtn);

forkBtn.addEventListener("click", () => {
database.user.getIdToken().then((token) => {
const user = firebase.auth().currentUser;
user.getIdToken().then((token) => {
database.getRecipeImage(recipe.name, profile).then((url) => {
fetch(url, {
headers: {
Expand Down
2 changes: 1 addition & 1 deletion storage.rules
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ service firebase.storage {
allow read;
}
match /users/{userId}/{allPaths=**} {
allow read, write: if request.auth != null && request.auth.uid == userId;
allow read, write: if request.auth != null && request.auth.uid == userId && request.auth.uid == request.path[1];
}
}
}

0 comments on commit 8f150f5

Please sign in to comment.