avitorio / outstatic

Outstatic - A static CMS for Next.js

Home Page:https://Outstatic.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OST_REPO_OWNER is not used for /api/image

vildzi opened this issue · comments

commented

Provide environment information

ENV Flags Set:

  • OST_GITHUB_ID
  • OST_GITHUB_SECRET
  • OST_TOKEN_SECRET
  • OST_REPO_SLUG
  • OST_REPO_BRANCH
  • OST_REPO_OWNER

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

Describe the Bug

When a user who is not the owner of the repo (and OST_REPO_OWNER is set) is adding or viewing images in a post, a "Couldn't load image." error occurs.
Screenshot 2023-02-15 at 11 25 00 AM

Expected Behavior

OST_REPO_OWNER should be used when getting images from raw.githubusercontent.com if set rather than always using the current users username.

Link to reproduction - Issues with a link to complete (but minimal) reproduction code will be addressed faster

N/A - any deployment with OST_REPO_OWNER set will work to reproduce the issue

To Reproduce

  • Log in to outstatic as a user who is not the owner of the repo
  • Attach an image to a post

@vildzi Thank you for this! I just merged your PR!