Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Website detect logout status #150

Open
linux4life798 opened this issue Dec 7, 2018 · 1 comment
Open

Website detect logout status #150

linux4life798 opened this issue Dec 7, 2018 · 1 comment

Comments

@linux4life798
Copy link
Member

The login page should be presented (with auto-redirect) when your login token has expired and you are trying to access some resource. Currently, an error is just displayed and you have to find some way to get to the main page to login.

Two problem scenarios where this occurs:

  1. When your cookie has expired and you try to refresh the page on a device. An annoying error is displayed and there is no easy way to re-login.
  2. When you click a link to a device and your current web browser is not logged in. The same annoying error is shown without a way to login.
@hi-liang
Copy link
Member

hi-liang commented May 9, 2019

Currently the redirects to home on each component (device, location, etc) are one-off error handlers based on subscription response of their respective getter requests (e.g. getDevice()).
Example:

error => this.router.navigate(['/home'])

This should be handled at a much lower level. Unfortunately each of the services have (copies of) their own error handlers, e.g.

private handleError (error: Response | any) {

TLDR: All of this should be refactored so at lowest level possible a 401 error response leads to popup of the login component.

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

No branches or pull requests

2 participants