# 사용자가 이미 로그인했는지 확인하는 방법?

**URL:** https://meta.discourse.org/t/how-to-check-whether-a-user-already-logined/134446
**Category:** Development
**Created:** [11월 26, 2019, 3:04오후 UTC](https://meta.discourse.org/t/how-to-check-whether-a-user-already-logined/134446 "2019-11-26T15:04:31Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![edisonking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/edisonking/32/161362_2.png) [@edisonking](https://meta.discourse.org/u/edisonking)
#### Post date: [11월 26, 2019, 3:04오후 UTC](https://meta.discourse.org/t/how-to-check-whether-a-user-already-logined/134446/1 "2019-11-26T15:04:31Z")

</div>

API "/admin/user/{user\_id}/log\_out"를 호출하여 사용자를 로그아웃시키려 합니다. 하지만 그 전에 사용자가 이미 로그인 상태인지 확인해야 합니다. 이 목적을 위한 API가 있나요?

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [11월 26, 2019, 3:08오후 UTC](https://meta.discourse.org/t/how-to-check-whether-a-user-already-logined/134446/2 "2019-11-26T15:08:54Z")

</div>

관리자 권한이 있는 API 키를 사용하면 사용자 정보(예: `https://meta.discourse.org/u/david.json`)를 가져온 다음, `user_auth_tokens` 배열에서 활성 세션 목록을 확인할 수 있습니다. 배열이 비어 있으면 해당 사용자가 어디에도 로그인되어 있지 않은 것입니다.

---

<div class="post-metadata">

### Author: ![edisonking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/edisonking/32/161362_2.png) [@edisonking](https://meta.discourse.org/u/edisonking)
#### Post date: [11월 26, 2019, 3:33오후 UTC](https://meta.discourse.org/t/how-to-check-whether-a-user-already-logined/134446/3 "2019-11-26T15:33:51Z")

</div>

정말 감사합니다. 큰 도움이 되었습니다!
