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

Password-protected links w/ device targeting enabled redirects to the original destination URL #385

Closed
unrenamed opened this issue Sep 21, 2023 · 4 comments

Comments

@unrenamed
Copy link
Contributor

I was testing the link creation and noticed that if iOS or Android targeting is enabled and the link is protected with a password, the iOS / Android users will be redirected to the original destination URL on opening.

Steps to reproduce:

  1. Open the link creation modal
  2. Enter any Destination URL (e.g. https://www.google.com) and Short link
  3. Toggle password protection on and enter your password
  4. Toggle iOS/Android targeting on and enter a different redirection link
  5. Save changes
  6. Open the link on your iOS/Android device and in your web browser on your PC/laptop

Actual behavior:
Both links redirect to the Destination URL (https://www.google.com in this example).

Expected outcome:
Links opened on iOS/Android redirect to URLs provided in Step 4.

I haven't found any explanation for such behavior in Dub Help Center . Yet I'm not quite sure this is a bug. Does anyone have an idea whether this is a bug or the actual behavior is already expected?

Dev note
This makes sense given the code to rewrite the URL to /protected/[domain]/[key] lib/middleware/link.ts is executed earlier than the middleware starts checking the user agent data containing device details. However, this finding doesn't answer my question above.

@steven-tey
Copy link
Collaborator

Ah good catch – this is expected behavior since device targeting is not supported currently for password protected pages. Curious what would your use case be?

Will document this in the meantime!

@unrenamed
Copy link
Contributor Author

@steven-tey Thank you for verifying this is the expected behavior. Yes, it'd be great if this limitation is documented so users don't get confused when combining several options for their links.

As for an example use case, I don't have any at the moment. As I said, I've been just testing the app and was curious about it from the dev perspective 👨‍🔬

Although I can imagine a case when protected links are necessary (e.g. URL params contain some sensitive info), I don't think such a scenario should support device targeting unless there is a high demand for it.

steven-tey added a commit that referenced this issue Sep 24, 2023
@steven-tey
Copy link
Collaborator

Just documented this: https://dub.co/help/article/how-to-create-link

CleanShot 2023-09-23 at 20 30 07
CleanShot 2023-09-23 at 20 30 07

Thank you so much again for the heads-up!

@steven-tey
Copy link
Collaborator

@unrenamed Good news – this limitation has been fixed in our latest update: https://dub.co/changelog/improved-password-links

You can now use password protection with geo/device targeting! :)

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

No branches or pull requests

2 participants