Greenstand / Greenstand/treetracker-admin-client

401 Unauthorized response to check_session doesn't trigger logout

Open
#290 2 comments 0 reactions 0 assignees View on GitHub
on hold size: medium type: bug
Dominant language
JavaScript
Stars
36
Forks
212
PR merge metrics
No merged PRs in 30d

Description

When a user's session has expired, the JWT token changes or a developer switches between a local backend and a cloud backend, reloading the dashboard triggers several API calls that return 401 (unauthorized) errors.

This triggers confusing errors in development:
![Screenshot 2022-01-14 at 21 09 52](https://user-images.githubusercontent.com/5558838/149586546-95ee377a-cef1-4455-aefe-8e43e684a745.png)
In production, the dashboard appears stuck, with no indication of what's happened:
![Screenshot 2022-01-14 at 21 10 12](https://user-images.githubusercontent.com/5558838/149586424-f2754e61-c429-4567-a068-7241650baf5c.png)
It should be up to `/auth/check_session` to check whether the session is still valid, and a 401 response to this should trigger a logout redirect, but this doesn't seem to be working properly.
Other API calls should ideally be paused until `check_session` has completed.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.