# Onebox redirects prevent linking to login-only content

**URL:** <https://meta.discourse.org/t/onebox-redirects-prevent-linking-to-login-only-content/93632>\
**Category:** Feature\
**Tags:** onebox\
**Created:** [01.Август.2018 09:26:26 UTC](https://meta.discourse.org/t/onebox-redirects-prevent-linking-to-login-only-content/93632 "2018-08-01T09:26:26Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)\
**Post date:** [01.Август.2018 09:26:26 UTC](https://meta.discourse.org/t/onebox-redirects-prevent-linking-to-login-only-content/93632/1 "2018-08-01T09:26:26Z")

</div>

Onebox follows redirects, which is usually a good thing, I guess.

This becomes a problem, however, when you share a link to a page requiring sign-in that simply redirects to a sign-in page when an anonymous user visits it.

For example, if I want to share my top secret project hosted at `https://dgit.cs.uni-saarland.de/fefrei/my-top-secret-project/` in the internal category of our Discourse instance, this is what I get by default:

> **[Sign in · GitLab](https://dgit.cs.uni-saarland.de/users/sign_in)**
>
> dGit GitLab Instance

Note that all links in the Onebox go to `https://dgit.cs.uni-saarland.de/users/sign_in`, which is not helpful.

Of course, as a post author, I can prevent that by using any alternative markup that prevents the Onebox (which can’t show relevant content anyways); but if some other user does this and doesn’t notice, it’s pretty hard to retrieve the actual link.  
As staff, I can edit the post to get the raw markup, but as a non-staff user, I think the only feasible workaround is to remember the magic `/raw/` URL scheme.

Why does the Onebox link to the final location, not the original URL? Can we do something to improve this?

---

_[View the full topic](https://meta.discourse.org/t/onebox-redirects-prevent-linking-to-login-only-content/93632)._
