Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

isLoggedIn method of EcmAuth client is returning "true" when ticket expires #210

Closed
chris-equis opened this issue Apr 4, 2017 · 1 comment
Assignees
Milestone

Comments

@chris-equis
Copy link

chris-equis commented Apr 4, 2017

Type of issue: (check with "[x]")

- [ ] New feature request
- [x] Bug  
- [ ] Support request

Current behavior:

calling isLoggedIn() returns true if the ticket is expired

Expected behavior:

calling isLoggedIn() should return false if the ticket is expired

Steps to reproduce the issue:

  1. Use EcmAuth instance to login with valid credentials
  2. Check that the ticket-ECM key was registered in LocalStorage and it has stored the ticket
  3. Wait until the ticket expires or modify (not delete) the ticket directly in LocalStorage
  4. console.log(instance.isLoggedIn()) returns true because it just checks that there is a ticket but not its validity
@chris-equis chris-equis changed the title isLoggedIn method of EcmAuth client is returning true when ticket expires isLoggedIn method of EcmAuth client is returning "true" when ticket expires Apr 5, 2017
@eromano eromano self-assigned this Apr 6, 2017
@eromano eromano added this to the 1.3.1 milestone Apr 6, 2017
@eromano
Copy link
Contributor

eromano commented Apr 7, 2017

In the alfresco-js-api is already present validateTicket() method that checks the ticket against the server and returns a promise.

Change now the isLoggedIn in this way could have two side effects:

  • too many calls against the server
  • breaking change with the firm of the actual isLoggedIn

We could think a way to check the token if is still valid and invalidate the localstorage after some events as 401

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants