Fix register route blocked by oauth state restoration feature

This commit is contained in:
SleepWalker
2016-10-25 09:01:51 +03:00
parent 38196e8f76
commit abf5fbbef6
2 changed files with 10 additions and 2 deletions

View File

@@ -96,6 +96,12 @@ describe('AuthFlow', () => {
expect(flow.setState, 'was called once');
});
it('should not restore oauth state for /register route', () => {
flow.handleRequest({path: '/register'});
expect(flow.run, 'was not called'); // this.run('oAuthValidate'...
});
it('should not restore outdated (>1h) oauth state', () => {
localStorage.setItem('oauthData', JSON.stringify({
timestamp: Date.now() - 2 * 60 * 60 * 1000,