lenra-io / server

GNU Affero General Public License v3.0
6 stars 0 forks source link

fix: Hydra OAuth Token invalid when server is reset #568

Closed jonas-martinez closed 2 months ago

jonas-martinez commented 2 months ago

About this PR

Very closely linked to https://github.com/lenra-io/devtool/issues/210

Technical highlight/advice

Do not return errors when the oauth token is invalid, just redirect to the register page as we don't know what could have caused the issue. It is better to get a new token than trying to fix an unfixable data corruption.

How to test my changes

Please see @taorepoara comments on https://github.com/lenra-io/devtool/issues/210 for testing instructions. You basically need to start a server, register and connect. Then you need to reset the server and try to log in back into it with the same old oauth token. It should redirect you to the register page.

Before my change it just showed an error.

Checklist

I included unit tests that cover my changes

I added/updated the documentation about my changes

taorepoara commented 2 months ago

I'll look at the devtool to see if the problem is linked even if the workflow is not the same