# Logging back in after logout fails

**URL:** <https://discourse.nodered.org/t/logging-back-in-after-logout-fails/25273>\
**Category:** General\
**Created:** [21 April 2020 22:53 UTC](https://discourse.nodered.org/t/logging-back-in-after-logout-fails/25273 "2020-04-21T22:53:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![justAnotherDev](https://avatars.discourse-cdn.com/v4/letter/j/e8c25b/32.png) [@justAnotherDev](https://discourse.nodered.org/u/justAnotherDev)\
**Post date:** [21 April 2020 22:53 UTC](https://discourse.nodered.org/t/logging-back-in-after-logout-fails/25273/1 "2020-04-21T22:53:52Z")

</div>

I have login working as expected using Okta SSO, however when I log out using the Node RED panel I am unable to successfully log back in again. When I attempt to log back in the browser times out, returning a 504, and presents an `auth.invalid-token` error in the log.

Is there a step I am missing?

```auto
adminAuth: {
    type:"strategy",
    strategy: {
        name: "okta",
        label: "Sign in using Okta",
        icon:"fa-key",
        strategy: require("passport-okta-oauth").Strategy,
        options: {
            audience: "https://mycompany.okta.com",
            clientID: "XXXXXXX",
            clientSecret: "xxxxxx",
            scope: ["openid", "email", "profile"],
            response_type: "code",
            callbackURL: "https://mycompany.com/auth/strategy/callback",

            verify: function(accessToken, refreshToken, profile, done) {
                done(null, profile);
            }
        }
    },
    users: function(user) {
        return Promise.resolve({ username: user, permissions: "*" });
    }
}

```

---

<div class="post-metadata">

**Author:** ![justAnotherDev](https://avatars.discourse-cdn.com/v4/letter/j/e8c25b/32.png) [@justAnotherDev](https://discourse.nodered.org/u/justAnotherDev)\
**Post date:** [22 April 2020 23:20 UTC](https://discourse.nodered.org/t/logging-back-in-after-logout-fails/25273/2 "2020-04-22T23:20:30Z")

</div>

Ended up solving it by removing `.sessions.json` and `.config.json`. I think the tokens got out of sync and it was unable to recover, but not sure. Either way, it is fixed now. 🤷‍♂️

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [6 May 2020 23:20 UTC](https://discourse.nodered.org/t/logging-back-in-after-logout-fails/25273/3 "2020-05-06T23:20:38Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
