You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- [ ] New feature request
- [x] Bug
- [ ] Support request
Current behavior:
When a session has timed out (or the ticket has been invalidated), AlfrescoApi catches the error (401) and tries to invalidate the session. But AlfrescoApi.contentAuth object is undefined, so when the AlfrescoApi.errorHandler() calls this.invalidateSession() and this.contentAuth.invalidateSession(), it cause js undefined error.
ERROR TypeError: Cannot read properties of undefined (reading 'invalidateSession')
at AlfrescoApi.invalidateSession (alfrescoApi.js:397:30)
at AlfrescoApi.errorHandler (alfrescoApi.js:164:18)
at ContentClient.<anonymous> (alfrescoApi.js:153:18)
at ContentClient.emit (index.js:97:9)
at alfresco-adf-core-api.mjs:300:30
at catchError.js:10:39
at OperatorSubscriber._error (OperatorSubscriber.js:23:21)
at OperatorSubscriber.error (Subscriber.js:40:18)
at OperatorSubscriber._error (Subscriber.js:64:30)
at OperatorSubscriber.error (Subscriber.js:40:18)
It seems AlfrescoApi.contentAuth is initialized in AlfrescoApi.initAuth(), but it is called only if this.config.oauthInit is true (what is false on basic authentication).
Expected behavior:
At authentication error (401) AlfrescoApi.invalidateSession() should be called without error and invalidate the session (delete the ticket). Without this ADF LoginComponent detects, that the session is valid and redirects from the login screen.
Steps to reproduce the issue:
Authenticate with an ADF application, which uses AlfrescoApi (like Alfresco Content Application).
Find stored Alfresco ticket in the ADF app browser developer tool/local storage under ticket-ECM name.
Invalidate ticket with authentication API DELETE call:
Initiate an Alfresco REST API call from the ADF application.
Node version (for build issues):
v18.17.1
The text was updated successfully, but these errors were encountered:
werdy77
changed the title
Authentication error (401) cause undefined object error while tries to call invalidateSession()
Authentication error (401) causes undefined object error while tries to call invalidateSession()
Nov 29, 2023
Type of issue:
Current behavior:
When a session has timed out (or the ticket has been invalidated),
AlfrescoApi
catches the error (401) and tries to invalidate the session. ButAlfrescoApi.contentAuth
object isundefined
, so when theAlfrescoApi.errorHandler()
callsthis.invalidateSession()
andthis.contentAuth.invalidateSession()
, it cause js undefined error.It seems
AlfrescoApi.contentAuth
is initialized inAlfrescoApi.initAuth()
, but it is called only ifthis.config.oauthInit
istrue
(what isfalse
on basic authentication).Expected behavior:
At authentication error (401)
AlfrescoApi.invalidateSession()
should be called without error and invalidate the session (delete the ticket). Without this ADF LoginComponent detects, that the session is valid and redirects from the login screen.Steps to reproduce the issue:
Node version (for build issues):
v18.17.1
The text was updated successfully, but these errors were encountered: