InvenTree/docs/docs
Oliver f97cdef9fc
[PUI] Login / Logout State Fixes (#6368)
* Fix API endpoint URLs

* Adds "authenticated" field to root API endpoint

* Load global status data separately

- Create new global state manager
- Load *after* login
- Prevents auth popup dialog and failure messages

* Add launch config for frontend dev

* Update docs

* Clear token auth if no token is defined

* remove unneeded import

* Revert format of InfoView endpoint

* Remove "authenticated" from InfoView

* Refactor is_staff token check

- Using new get_token_from_request method

* Cleanup code

- return early

* URL fixes

- More fixes for incorrect api calls

* Better tracking of authenticated status

- track an internal flag in apiState

* Prioritize token auth

* Only fetch userState if authenticated

* Force unauthenticated state on first launch

* Updates to login procedure

- Rename doClassicLogin to doBasicLogin (reflecting "basic" auth)
- Add "loggedIn" attribute to sessionState
- Cleanup procedure for securing a token

* Abort early on checkLoginState

- Prevent failed calls to user_me

* Refactoring

- Simpler to just track token state
- No need for separate status tracker
- Works much cleaner this way

* Remove debug messages

* Cleanup unused imports

* Fix unused variable

* Revert timeout to 2000ms

* Rename doClassicLogout -> doLogout

* Improvements for checkLoginState

- Account for the presence of a CSRF session cookie
- If available, use it to fetch a token

* Clear CSRF cookie on logout

- Forces logout from session
- Tested, works well!
- Clean up notifications

* Cleanup setApiDefaults method

* fix global logout (PUI -> CUI)

---------

Co-authored-by: Matthias Mair <code@mjmair.com>
2024-02-02 12:02:55 +11:00
..
api correct Part uploadImage Parameter spelling (#5902) 2023-11-12 23:12:56 +11:00
app Sales order barcode allocate (#6072) 2023-12-14 11:13:50 +11:00
assets Sales order barcode allocate (#6072) 2023-12-14 11:13:50 +11:00
barcodes Add basic support for scanning vendor barcodes (#5509) 2023-10-19 23:28:21 +11:00
build Version bump (#5740) 2023-10-18 07:27:28 +11:00
concepts Add database model for defining custom units (#5268) 2023-07-19 06:24:16 +10:00
develop [PUI] Login / Logout State Fixes (#6368) 2024-02-02 12:02:55 +11:00
extend Move more paths to basic path (#6251) 2024-01-18 17:05:10 +11:00
javascripts Documentation integration (#4653) 2023-04-22 22:40:29 +10:00
order Update docs to match reality (#5255) 2023-07-15 23:55:22 +10:00
part Part pricing override (#5956) 2023-11-21 14:53:45 +11:00
releases Simplify release notes docs (#5063) 2023-06-17 21:56:26 +10:00
report Fix some issues in report docs. (#5918) 2023-11-15 10:42:57 +11:00
settings SSO config docs (#6297) 2024-01-20 15:31:17 +11:00
start SSO config docs (#6297) 2024-01-20 15:31:17 +11:00
stock Version bump (#5740) 2023-10-18 07:27:28 +11:00
stylesheets [Feature] Scrap Build Outputs (#4800) 2023-05-13 22:19:35 +10:00
webfonts Documentation integration (#4653) 2023-04-22 22:40:29 +10:00
__init__.py Fixes for docs building (#4659) 2023-04-22 23:35:25 +10:00
credits.md Remove support for django-debug-toolbar (#6196) 2024-01-11 07:18:20 +11:00
demo.md Documentation integration (#4653) 2023-04-22 22:40:29 +10:00
faq.md Update invoke docs (#6263) 2024-01-17 12:36:24 +11:00
features.md Company docs updates (#4710) 2023-04-27 22:27:21 +10:00
hooks.py [CI] docstrings (#6172) 2024-01-11 14:40:07 +11:00
index.md Documentation integration (#4653) 2023-04-22 22:40:29 +10:00
privacy.md Documentation integration (#4653) 2023-04-22 22:40:29 +10:00