Skip to content

Conversation

@denysoblohin-okta
Copy link
Contributor

@denysoblohin-okta denysoblohin-okta commented Aug 10, 2022

Resolves #97
Internal ref: https://oktainc.atlassian.net/browse/OKTA-521161

  • onLoad guard should not get redirect URL from segments as it does not have query params. Instead router.getCurrentNavigation() should be used.
  • Added unit & e2e tests.
  • Found bug after adding e2e test for lazy load module for Angular 7 in prod mode. See fix in comment below.

Preserve query params with onLoad guard
add e2e test
fix lint
fix lint - remove segments
fix e2e
test only angular-v14
13
7
@denysoblohin-okta denysoblohin-okta force-pushed the of-fix-query-onLoad-OKTA-521161 branch from d4d7ca3 to bb7394a Compare August 11, 2022 15:10
@denysoblohin-okta denysoblohin-okta marked this pull request as ready for review August 11, 2022 15:40
@denysoblohin-okta denysoblohin-okta force-pushed the of-fix-query-onLoad-OKTA-521161 branch 2 times, most recently from e0e4fbb to 7926bfe Compare August 11, 2022 18:31
Comment on lines 86 to 89
// Passing function produces 'Error: Runtime compiler is not loaded' for prod build. Passing string fixes the issue.
// See https://github.com/angular/angular-cli/issues/10582
loadChildren: () => import('./lazy-load/lazy-load.module').then(mod => mod.LazyLoadModule),
//loadChildren: './lazy-load/lazy-load.module#LazyLoadModule',
Copy link
Contributor Author

@denysoblohin-okta denysoblohin-okta Aug 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passing function produces Error: Runtime compiler is not loaded for prod build for Angular 7.
Passing string fixes the issue.
See angular/angular-cli#10582

Comment on lines 13 to 14
console.log('[DEBUG] Console: ', await browser.getLogs('browser'));
console.log('[DEBUG] Body: ', body);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added debug to catch errors like Error: Runtime compiler is not loaded above

trigger error
.


.
.
@denysoblohin-okta denysoblohin-okta force-pushed the of-fix-query-onLoad-OKTA-521161 branch from 7926bfe to 87f5790 Compare August 11, 2022 19:17
@eng-prod-CI-bot-okta eng-prod-CI-bot-okta merged commit 75f80f1 into master Aug 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Query params are stripped by canLoad guards when user isn't authenticated

4 participants