sofn-xyz / mailing

Build, test, send emails with React
https://www.mailing.run
MIT License
3.6k stars 74 forks source link

Feature request: password protected preview site #429

Closed maxsalven closed 1 year ago

maxsalven commented 1 year ago

I'd love to be able to password protect the entire preview site when I deploy it to production. I see that protections are available for the API routes but anyone who knows my Vercel URL can see all preview emails. I'd like to limit this to approved collaborators through a password.

alexfarrill commented 1 year ago

Hey there Max, this would be a welcome feature and we would be happy to review a PR. Thanks for making the issue!

jpalumickas commented 1 year ago

Hey, also would be nice to disable previews with ENV variable (for example DISABLE_PREVIEWS=true) in production. Maybe this would be easer to implement?

alexfarrill commented 1 year ago

@jpalumickas Thanks for the idea! cc: @maxsalven

I've released a beta version 0.9.10-next.0 that implements this. If you set DISABLE_PREVIEWS to something truthy, previews will be disabled.

Would you try it out and let me know if this solves your problem?

Thanks

jpalumickas commented 1 year ago

@alexfarrill it's working! maybe DISABLE_PREVIEWS check should be added to pages/index.ts to not do redirection to previews?

alexfarrill commented 1 year ago

@jpalumickas @maxsalven This is released in 0.9.11. Thank you again for using Mailing!