# 로그인 페이지로 리다이렉트되는 초기 페이지 비활성화

**URL:** https://meta.discourse.org/t/disable-initial-page-that-re-directs-to-login/400773
**Category:** Development
**Tags:** login
**Created:** [4월 16, 2026, 8:40오전 UTC](https://meta.discourse.org/t/disable-initial-page-that-re-directs-to-login/400773 "2026-04-16T08:40:01Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Ethsim2](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ethsim2/32/522255_2.png) [@Ethsim2](https://meta.discourse.org/u/Ethsim2)
#### Post date: [4월 16, 2026, 8:40오전 UTC](https://meta.discourse.org/t/disable-initial-page-that-re-directs-to-login/400773/1 "2026-04-16T08:40:01Z")

</div>

안녕하세요,

현재 로그인 버튼 하나만 눌러야 하는 번거로움을 줄이기 위해 느린 리다이렉트를 구현하고 있습니다.

```js
import { apiInitializer } from "discourse/lib/api";

export default apiInitializer("1.0", (api) => {
  api.onPageChange((url) => {
    const user = api.getCurrentUser();

    let path = url?.startsWith("http") ? new URL(url).pathname : url;
    path = path?.replace(/\/+$/, "") || "/";

    const allowedAnonPaths = ["/login", "/privacy", "/tos", "/pub/about-this-forum", "/safe-mode", "/pub/accessibility-statement"];

    if (!user && !allowedAnonPaths.includes(path)) {
      window.location.href = "/login";
    }
  });
});

```

이 코드에서는 리다이렉트를 원하지 않는 경로들을 제외하고 있습니다.

* * *

최적의 방법은 아니지만, 현재 [https://physicswithethan.discourse.diy](https://physicswithethan.discourse.diy) 에서 사용 중입니다.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [4월 17, 2026, 4:31오후 UTC](https://meta.discourse.org/t/disable-initial-page-that-re-directs-to-login/400773/2 "2026-04-17T16:31:14Z")

</div>

> [@Ethsim2](#):
>
> 초기 페이지의 유일한 로그인 버튼을 누르지 않아도 되도록 하려면

Discourse가 이미 그렇게 처리하고 있을 가능성이 큽니다. 작동하지 않는다면 설정에 문제가 있는 것입니다 🤔

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [4월 17, 2026, 4:43오후 UTC](https://meta.discourse.org/t/disable-initial-page-that-re-directs-to-login/400773/3 "2026-04-17T16:43:41Z")

</div>

음, 여기 먼저 클릭해야 하는 로그인 버튼이 보이네요:

 ![Screenshot_20260417_184223_Firefox](https://global.discourse-cdn.com/meta/original/4X/6/f/2/6f237acba19c5e0a95695b42b8f99986e87f225d.jpeg)

하지만 저는 그거 때문에 번거롭다고 느낀 적이 없어요. 내가 어디에 있는지 확인도 못 한 채 입력 폼으로 이동하게 되는 것이 더 나은 경험이라고 생각하지 않거든요. 여기서는 내가 어디에 있는지 관련 정보가 더 적어요:

 ![Screenshot_20260417_184750_Firefox](https://global.discourse-cdn.com/meta/original/4X/a/a/e/aae43a8bae40bac7bb6207be478c9ac9a28c2e5e.jpeg)

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [4월 17, 2026, 4:48오후 UTC](https://meta.discourse.org/t/disable-initial-page-that-re-directs-to-login/400773/4 "2026-04-17T16:48:41Z")

</div>

맞아 🤦‍♂️ 'home-page’를 예외 처리했었지… 다른 모든 페이지는 바로 로그인 페이지로 표시되어야 해. 설정으로 만들어야 하는 거 아님? 🤔

@pmusaraj 홈 페이지를 예외 처리한 이유가 뭔지 기억나?

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [4월 17, 2026, 6:56오후 UTC](https://meta.discourse.org/t/disable-initial-page-that-re-directs-to-login/400773/5 "2026-04-17T18:56:40Z")

</div>

네, 로그인 필수 사이트 대부분은 해당 랜딩 스크린이 있는 것이 유리합니다. 예를 들어, 가입이 가능한 경우 가입/로그인 버튼을 배치하고, 폼을 표시하기 전에 커뮤니티에 대한 설명을 할 수 있는 공간을 마련해 두는 식입니다.

우리는 한 가지 제한적인 사용 사례에서 이 스크린을 건너뛰는 기능을 제공합니다. 바로 사이트가 외부 로그인 방법을 하나만 사용하는 경우인데, 이 설정을 통해 가능합니다:

 ![CleanShot 2026-04-17 at 14.55.31@2x](https://global.discourse-cdn.com/meta/original/4X/6/f/8/6f8ef46408a6dfd41469c4485c594c5d5ffa4dda.png)

---

<div class="post-metadata">

### Author: ![Ethsim2](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ethsim2/32/522255_2.png) [@Ethsim2](https://meta.discourse.org/u/Ethsim2)
#### Post date: [4월 17, 2026, 7:05오후 UTC](https://meta.discourse.org/t/disable-initial-page-that-re-directs-to-login/400773/6 "2026-04-17T19:05:23Z")

</div>

![IMG_7114](https://global.discourse-cdn.com/meta/original/4X/4/2/a/42a1c5b78aa835f1a5c04e6a351472c685646d01.jpeg)

결국 [https://physicswithethan.discourse.diy에서](https://physicswithethan.discourse.xn--diy-k94n91q) 해당 설정이 활성화되어 있었습니다.

그래서 이 주제를 시작하기 전부터 설정을 변경한 적이 없습니다.
