Skip to content
This repository was archived by the owner on Feb 25, 2019. It is now read-only.
This repository was archived by the owner on Feb 25, 2019. It is now read-only.

/signout endpoint unhandled exception #351

@amokrushin

Description

@amokrushin

Error: Can't set headers after they are sent.
...
at /srv/nodejs/oidc/node_modules/anvil-connect/oidc/signout.js:53:13
...

How to reproduce:
send signout request with post redirect uri and valid token

connect/oidc/signout.js

Lines 53 to 67 in a21dd1f

res.redirect(303, postLogoutUri)
return
}
// Otherwise, fall through to default case below
})
}
// Handle all the other cases - no postLogoutUri specified, or the client is
// unknown, or the given postLogoutUri has not been registered previously.
// Do not redirect, simply sign out
authenticator.logout(req)
res.set({
'Cache-Control': 'no-store',
'Pragma': 'no-cache'
})
res.sendStatus(204)

In that case both res.sendStatus(204) and res.redirect(303, postLogoutUri) will be called in the same request and will cause the error

The test passed because there is a mistake:
62b538b

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions