bcgov / namerequest

Public Front End for the Name Request System
1 stars 42 forks source link

sentry errors related to keycloak calls #590

Closed bolyachevets closed 1 year ago

bolyachevets commented 1 year ago

*Issue: /bcgov/entity/issues/6970

*Description of changes: The main loop in the vue app tries to sync the token every time changes are detected, i.e. before we are redirected to /signin and after we are redirected to /signout the path is /namerequest and we call initializeToken. Majority of still relevant sentry errors take place during logout (i.e. at https://www.bcregistry.ca/namerequest/signout - see full list of errors here https://registries.sentry.io/issues/2098686855/events/?project=5433955&referrer=issue-stream&statsPeriod=14d). The errors take place right after the session is cleared and PREVENT_STORAGE_SYNC flag is set during the logout. Checking for PREVENT_STORAGE_SYNC the flag should prevent us from fetching userInfo when we don’t have the token, as auth-api returns 401 error if auth token is not provided in /users/@me calls (authorization_header_missing errors can be observed in the developer tools console)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the namerequest license (Apache 2.0).