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

feat: preview link as #849

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yashsharma999
Copy link
Contributor

Fixes #696

Description

Quickly view the document/dataroom without going through access form, nda, verification etc.

Screenshots

Screenshot 2024-10-13 at 12 08 58 AM

Copy link

vercel bot commented Oct 12, 2024

@yashsharma999 is attempting to deploy a commit to the mftsio Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Owner

@mfts mfts left a comment

Choose a reason for hiding this comment

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

I like it. But it's potentially exploitable because it's just a url query param.

Instead we need to verify it server-side and only allow it if previewToken passes

@yashsharma999
Copy link
Contributor Author

alright, but essentially we need to somehow bypass isProtected prop if i'm not wrong ?

isProtected={
            viewAs === "QUICK_PREVIEW"
              ? false
              : !!(emailProtected || linkPassword || enableAgreement)
          }

@mfts
Copy link
Owner

mfts commented Oct 19, 2024

but essentially we need to somehow bypass isProtected prop if i'm not wrong ?

@yashsharma999 yes that's correct. but right now with your current implementation, you could add ?viewAs=QUICK_VIEW to any normal link and it would bypass the isProtected.

Also as I'm writing it, we double check server-side actually if the link is protected again, so you'd need to pass something to the api function to get around the protection

@mfts mfts added revisit Currently not required but important in the future iteration-1 labels Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[🕹️] Preview as guest
2 participants