Onebox redirects prevent linking to login-only content

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:

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?

2개의 좋아요

Why wouldn’t it link to the final location?

I typed https://dgit.cs.uni-saarland.de/fefrei/my-top-secret-project/, why should it link somewhere else?

When I’m redirected to the sign in page, this is fine, because I’m in a session – I can actually log in, and will be redirected back to the target URL.
When Discourse follows the redirect, forgets the original URL and just outputs the sign in URL, the reader has no (easy) way to get to the URL the author linked to.

Well, the workaround is to enter the link with angle brackets. It’s normal and expected to follow link redirects to the final destination.

I know that’s the current behavior, and already mentioned the workaround above:

I stumbled about this because another user fell for this trap, and I had to fish the actual link out of the raw view.

I’m not saying that this is terribad and needs to be fixed now or else; I’m just reporting that I find it sad that a user who simply pasted a link into his post got a Onebox that obfuscates the link in a way that makes it impossible for the average user to understand where to go. (There’s a reason I posted this in Contribute > Feature.)

1개의 좋아요

오늘 이 동작을 경험했고, UX 변경을 지지합니다.

최종 위치로 링크를 걸지 않기를 원하는 경우는, 링크를 공유하는 상대방이 인증된 상태이거나 링크된 사이트에서 인증할 수 있을 것으로 기대할 때입니다.

또한 외형적인 문제도 있습니다. 다른 커뮤니티에 discourse 스레드 링크를 게시했는데, 링크가 로그인 페이지를 가리키도록 변경되었습니다. 사람들이 의도적으로 로그인 페이지에 링크를 걸기 때문에 잘못된 링크를 올린 것이 아닌지 물어보았습니다. 결국 이는 사용자가 게시하고자 했던 내용을 변경하는 것입니다.

우회 방법은 유효하지만 좋지 않습니다. 특히 게시자와 링크를 클릭하는 사용자에게 나쁜 UX를 피하고 싶다면 더 지능적인 기본값이 있어야 합니다.

3개의 좋아요

이 문제를 해결하는 방법으로 “sign in” 문자열 매칭을 통해 하드코딩하는 것 외에는 떠오르지 않습니다. 솔직히 이 해결책은 정말 마음에 들지 않습니다. 매우 취약한 구조가 될 테니까요.

왜 그런 것이 필요할까요?

이것이 혼란의 원인이라면 죄송합니다. 하지만 제 초기 요청이 불분명했을 수 있습니다. 명확히 설명드리겠습니다:

사용자가 https://example.org/a로 링크했지만, 로그인하지 않은 경우 https://example.org/login으로 리다이렉트된다고 가정해 보겠습니다. 현재 동작은 다음과 같습니다:

  1. Discourse가 https://example.org/a를 요청하고 리다이렉트를 따릅니다.
  2. Discourse가 https://example.org/login을 요청하여 제목, 이미지 등을 가져옵니다.
  3. Discourse가 https://example.org/login에서 가져온 정보를 보여주는 원박스(Onebox)를 표시합니다. 그리고 https://example.org/login으로 링크합니다. 생성된 원박스는 어디에도 https://example.org/a로 링크하지 않습니다.

문제라고 생각하는 부분은 굵게 표시된 부분뿐입니다. 물론 링크를 따라 해당 위치에서 정보를 가져오는 것은 당연하지만, 원박스는 항상 제가 입력한 URL로 링크해야 합니다.

이것은 원박스가 로그인 페이지의 정보를 표시하는 것(그렇지 않으면 무엇을 표시해야 합니까?)에 관한 것이 아니라, 단순히 원박스 생성 과정에서 원래 링크 대상이 완전히 가려지는 문제에 관한 것입니다.

이것이 구현된다면, 제 원래 게시물에 있는 원박스는 여전히 동일한 모습으로 보이지만 https://dgit.cs.uni-saarland.de/fefrei/my-top-secret-project/로 링크하게 될 것입니다.

이제 더 명확해 보이나요? :slight_smile:

3개의 좋아요

그렇지는 않아요. 요즘 인터넷의 대부분의 "링크"가 결국 어떤 형태로든 리디렉션이니까요?

그럼 뭐가 문제라는 거죠? 사용자가 링크를 클릭하면 원박스(Onebox) 처리되지 않은 링크와 마찬가지로 리다이렉트가 정상적으로 작동할 텐데요…

1개의 좋아요

네.

리다이렉트되는 대상이 아니라 원래 링크한 대상과 연결하는 것이 더 합리적입니다. 이렇게 하면 해당 문제가 해결되고, 제가 생각하기에 아무것도 깨지지 않습니다.

모든 것이 리다이렉트된다면, 원래 링크를 유지하는 것이 훨씬 더 합리적입니다.

3개의 좋아요

동의하지 않습니다 – 당신이 알고 싶은 것은 일반적인 링크 단축 서비스를 클릭했다는 사실이 아니라, 최종적으로 도달할 대상이 무엇인지입니다. 이 부분에서는 정반대의 관점을 가지고 있습니다.

hey you’re gonna click on link.is/ghwk4fe3

라고 보여주는 것보다

hey you’re gonna click on example.com/funny-article

라고 보여주는 것이 훨씬 더 유용합니다.

1개의 좋아요

하지만 여기서 이야기하는 것은 Oneboxes입니다. 어차피 Oneboxes가 아닌 경우에는 이렇게 하지 않습니다.
또한, 사실 최종 URL을 표시하는 데는 반대하지 않습니다. 하지만 원래 URL로 링크하지 않으면 로그인 필요 시나리오에서 링크가 깨져버리거든요 :frowning:

5개의 좋아요

이 부분은 전혀 이견이 없는데, 로그인 페이지 예시를 직접 시도해 보시길 권합니다. 메타에 비공개 카테고리의 예시가 있을까요? 만약 그런 카테고리가 있고 제가 이 답글에 링크를 올렸다고 생각해 보세요. 원 박스(one boxes)의 작동 방식 때문에 그 링크가 어디로 가는지 알 수도, 해당 페이지에 접근할 수도 없게 됩니다.

원 박스가 최종 페이지의 내용을 표시하는 것에는 문제가 없지만, 원래 URL을 유지하지 않으면 이 시나리오에서 리디렉션이 의도한 대로 작동할 가능성이 완전히 사라집니다. 또한 원래 링크에 포함된 출처 표시 태그도 함께 사라지게 됩니다.

3개의 좋아요