Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sign out leaves zombie session after deleting user #343

Closed
danieldunderfelt opened this issue Jul 5, 2022 · 3 comments
Closed

Sign out leaves zombie session after deleting user #343

danieldunderfelt opened this issue Jul 5, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@danieldunderfelt
Copy link

I am doing a delete user feature, but after I delete the user and sign out, I cannot access the /auth path again as there seems to be some kind of session still alive.

Normal logging out without deleting the user works.

Attached are frontend and backend logs.

be_logs.txt

fe_logs.txt

@rishabhpoddar
Copy link
Contributor

Until this is fixed, a workaround is to override the signOutPOST API function in the Session.init as follows:

Session.init({
    override: {
        apis: (oI) => {
            return {
                ...oI,
                signOutPOST: async function (input) {
                    let resp = await oI.signOutPOST!(input);
                    if (resp.status === "OK") {
                        throw new Session.Error({
                            message: "Sign out",
                            type: "UNAUTHORISED",
                        })
                    }
                    return resp;
                }
            }
        }
    }
})

rishabhpoddar added a commit that referenced this issue Jul 5, 2022
rishabhpoddar added a commit that referenced this issue Jul 5, 2022
@rishabhpoddar rishabhpoddar added the bug Something isn't working label Jul 5, 2022
@danieldunderfelt
Copy link
Author

Until this is fixed, a workaround is to override the signOutPOST API function in the Session.init as follows:

Session.init({
    override: {
        apis: (oI) => {
            return {
                ...oI,
                signOutPOST: async function (input) {
                    let resp = await oI.signOutPOST!(input);
                    if (resp.status === "OK") {
                        throw new Session.Error({
                            message: "Sign out",
                            type: "UNAUTHORISED",
                        })
                    }
                    return resp;
                }
            }
        }
    }
})

I confirm this works in my app.

rishabhpoddar added a commit that referenced this issue Jul 5, 2022
* fix!: makes changes to the session recipe functions (#340)

* makes changes to the session recipe

* fixes tests

* cleans up error throwing in sessionCLass

* fixes issue #343 (#344)
@rishabhpoddar
Copy link
Contributor

Fixed in version v11.0.0 of the node SDK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants