Persist relative return-to path for post-login redirect
Co-Authored-By: Codex <codex@openai.com>
This commit is contained in:
@@ -91,4 +91,15 @@ describe('MainContainer beforeRouteEnter', () => {
|
||||
|
||||
expect(next).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('stores a relative return-to path when redirecting to login', async () => {
|
||||
window.history.replaceState({}, '', '/discover/log/1/map?view=summary#node-2');
|
||||
|
||||
await callGuard();
|
||||
|
||||
const redirectArg = next.mock.calls[0][0];
|
||||
const returnTo = redirectArg.query['return-to'];
|
||||
|
||||
expect(atob(returnTo)).toBe('/discover/log/1/map?view=summary#node-2');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user