# Logout oauth2

**URL:** https://community.homey.app/t/logout-oauth2/105658
**Category:** Developers
**Created:** [March 6, 2024, 1:05pm UTC](https://community.homey.app/t/logout-oauth2/105658 "2024-03-06T13:05:04Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![julianao](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/julianao/32/79652_2.png) [@julianao](https://community.homey.app/u/julianao)
#### Post date: [March 6, 2024, 1:05pm UTC](https://community.homey.app/t/logout-oauth2/105658/1 "2024-03-06T13:05:04Z")

</div>

I am trying to implement a logout function using the homey-oauth2app in a Homey app. The documentation isn’t clear on this, and I can’t find relevant Homey-specific guidance.

Has anyone here dealt with this before? Any advice or resources would be appreciated.

Thanks.

---

<div class="post-metadata">

### Author: ![Dijker](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@Dijker](https://community.homey.app/u/Dijker)
#### Post date: [March 6, 2024, 3:55pm UTC](https://community.homey.app/t/logout-oauth2/105658/2 "2024-03-06T15:55:15Z")

</div>

> moved to developers category

---

<div class="post-metadata">

### Author: ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)
#### Post date: [March 10, 2024, 9:33am UTC](https://community.homey.app/t/logout-oauth2/105658/3 "2024-03-10T09:33:26Z")

</div>

With oauth, you just get an access token. You can’t logout.  
You can remove the access/refresh token. Then you will get an access error on next API call.  
It it what you want?

You can take a look at the API documentation if such a function is provided. I haven’t used it before.  
Perhaps this one setting a blank token.

> **[OAuth2Client - Homey OAuth2](https://athombv.github.io/node-homey-oauth2app/OAuth2Client.html#setToken)**

---

<div class="post-metadata">

### Author: ![julianao](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/julianao/32/79652_2.png) [@julianao](https://community.homey.app/u/julianao)
#### Post date: [March 13, 2024, 11:45am UTC](https://community.homey.app/t/logout-oauth2/105658/4 "2024-03-13T11:45:33Z")

</div>

Yes, I can remove the access/refresh token. But then I will only get unauthorized API responses, and the user does not have the possibility to login again I think.

---

<div class="post-metadata">

### Author: ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)
#### Post date: [March 13, 2024, 12:12pm UTC](https://community.homey.app/t/logout-oauth2/105658/5 "2024-03-13T12:12:07Z")

</div>

This re-auth should be done via repair view.  
You are using the repair function similar to pair function showing the login popup.
