# Vue.js + Keycloak 18.0.0 with logout problem

**URL:** <https://forum.keycloak.org/t/vue-js-keycloak-18-0-0-with-logout-problem/18532>\
**Category:** Getting advice\
**Tags:** authentication\
**Created:** [November 21, 2022, 9:07pm UTC](https://forum.keycloak.org/t/vue-js-keycloak-18-0-0-with-logout-problem/18532 "2022-11-21T21:07:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jvhk](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/jvhk/32/6770_2.png) [@jvhk](https://forum.keycloak.org/u/jvhk)\
**Post date:** [November 21, 2022, 9:07pm UTC](https://forum.keycloak.org/t/vue-js-keycloak-18-0-0-with-logout-problem/18532/1 "2022-11-21T21:07:42Z")

</div>

Hey guys, im having a problem to setup the logout using Vue.js 2 and keycloak-js on version 18.0.0.

Reading 2022/04 release [https://www.keycloak.org/2022/04/keycloak-1800-released#\_openid\_connect\_logout](https://www.keycloak.org/2022/04/keycloak-1800-released#_openid_connect_logout) i understood that when logging out I must pass the following parameters in the method call:  
the **id\_token\_hint** (ID Token used for login) and **post\_logout\_redirect\_uri** (where I want to redirect the route).

So, I’m doing it this way:

 ![image](https://global.discourse-cdn.com/free1/uploads/keycloak/original/2X/1/19f0e9cf60c128815f4f906f25aaf369dbe6bfe5.png)

But I get this message on the screen and analyzing the request I realize that the redirect did not try to go to the logout route that I defined and the parameter id\_token\_hint is set to “undefined”. Am I doing it correctly in code and the problem must be somewhere else or is the problem the way I’m passing the parameters?

![image](https://global.discourse-cdn.com/free1/uploads/keycloak/original/2X/0/0ca2b19aa47d10fb55b9072615e8f2dacd002998.png)

---

<div class="post-metadata">

**Author:** ![midlane\_jake](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/midlane_jake/32/3390_2.png) [@midlane\_jake](https://forum.keycloak.org/u/midlane_jake)\
**Post date:** [November 22, 2022, 11:11am UTC](https://forum.keycloak.org/t/vue-js-keycloak-18-0-0-with-logout-problem/18532/2 "2022-11-22T11:11:13Z")

</div>

I’m using vanilla TS without adapter on react, so might not be of much help, but according to the source code ([keycloak/keycloak.js at main · keycloak/keycloak · GitHub](https://github.com/keycloak/keycloak/blob/main/adapters/oidc/js/src/keycloak.js#L1367)) the options-object passed to logout should contain a “redirectUri” property, not “post\_logout\_redirect\_uri”.

Also according to the createLogoutUri-function ([keycloak/keycloak.js at 28fc5b4574ed5c8cc000ae11d5595d91af7f6a70 · keycloak/keycloak · GitHub](https://github.com/keycloak/keycloak/blob/28fc5b4574ed5c8cc000ae11d5595d91af7f6a70/adapters/oidc/js/src/keycloak.js#L479)) the idtoken should not be passed in. Instead it is taken from the Keycloak-object that you call logout on. So either you don’t have an idtoken (did you pass the scope “openid” when you logged in?) or maybe you messed up the objects somehow?
