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.
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