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

Panoptes.js Experimental Auth: add checkCurrentUser() aka checkCurrent() #6552

Open
wants to merge 5 commits into
base: remove-pjc-experiment-pt1
Choose a base branch
from

Conversation

shaunanoordin
Copy link
Member

PR Overview

Package: Package: lib-panoptes-js
Part of: replacing PJC with Panoptes JS
Follows and requires: #6375

This PR continues the experiment to remove PJC from FEM. In this PR, we add the ability to check the current user, via checkCurrentUser(), to the Experimental Auth system.

  • Experimental Auth: added checkCurrentUser() (and its alias for backwards compatibility, checkCurrent() )
    • checkCurrentUser() will return the current signed-in User if the Panoptes API recognises there's one, based on the http-only Panoptes session cookies.
    • In the context of FEM, this is pretty much always used at the start of app load, start of page load, and/or the start of API function calls.
  • Dev server: new "check current user" button added, to manually trigger the action.

Status

Ready for internal team review.

Please note that the code is verbose on purpose. I can fold a lot of the functionality into reusable functions (e.g. checkBearerToken() / fetchBearerToken() ) but I want to make sure that everyone on the team can read through & understand the process as easily as possible.

@shaunanoordin shaunanoordin changed the title Remove pjc experiment pt3 Panoptes.js Experimental Auth: add checkCurrentUser() aka checkCurrent() Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant