Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(config): allow svg and increase body size #1729

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

purusott
Copy link
Collaborator

After: can upload svgs and files with size less than 10mb (svg img uploaded below)

  • image

Copy link
Collaborator

@emilielr emilielr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Må være litt forsiktig med tanke på sikkerhet osv med denne PRen. Kanskje det er greiest om man dropper å kunne laste opp SVG? 🤔

tavla/next.config.js Show resolved Hide resolved
tavla/next.config.js Outdated Show resolved Hide resolved
.gitignore Show resolved Hide resolved
return setFormError(getFormFeedbackForError('file/invalid'))
case 403:
return setFormError(
getFormFeedbackForError('auth/operation-not-allowed'),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vil denne casen noen gang vises? Siden om man får 403, så blir man bare redirected til forsiden og denne formErroren vil aldri vises til noen

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ja, det stemmer! Har tenkt litt over det og mtp at det er gjennom APIet tenker jeg at vi heller bør fjerne redirect fra den og bare returnere 403 (forbidden). Da får man riktig respons om man prøver å poste utenfor uiet vårt 🤔 Jeg har ikke sett et API returnere redirect om man ikke har tilgang 💭 det passer vel mer til slik vi hadde det før

tavla/package.json Show resolved Hide resolved
tavla/app/api/upload/route.ts Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brukere vil jo kjenne til dette endepunketved å se via nettverkskall og slikt. Burde vi sikre det på noe vis? Nå kan man pr def spamme oss ned med logoer

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bra tenkt :) Skal undersøke rate-limiting.

tavla/app/(admin)/utils/index.ts Show resolved Hide resolved
setFile(e.target.value)
setFileName(e.target?.files?.item(0)?.name ?? 'Logo uten navn')

const selectedFile = e.target.files?.[0]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kunne man heller returnert denne mye tidligere om files ikke fantes? Så slipper vi å håndtere !selctedFile?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants