anvilresearch / connect

A modern authorization server built to authenticate your users and protect your APIs
http://anvil.io
MIT License
361 stars 85 forks source link

/signout endpoint unhandled exception #351

Open amokrushin opened 7 years ago

amokrushin commented 7 years ago

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

https://github.com/anvilresearch/connect/blob/a21dd1ff17d4893bb97eb7beb455888afb10eea0/oidc/signout.js#L53-L67

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: 62b538b08c0a48321763b9b69123d9d676bbded9

camfou commented 7 years ago

352 PR fix this issue !

christiansmith commented 7 years ago

Thanks @camfou! Just merged #352.

@amokrushin, please let me know if this solves your issue.

Sorry everyone for neglecting this repo recently. I've been a little distracted from working with the good people at CSAIL on OIDC for https://solid.mit.edu/

New packages in the works that should eventually find their way back into Anvil Connect :) Ping me on gitter if anyone wants a preview. We could use the extra eyes.