-
Notifications
You must be signed in to change notification settings - Fork 0
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
Authenticate with nmdc-server backend #26
Merged
Merged
Commits on Feb 7, 2024
-
Replace standalone api functions with singleton object pattern.
This replaces the standalone API request functions with an NmdcServerClient class with equivalent methods. A singleton instance of this class is constructed and exported. This allows an API token to be set on this instance and all subsequent requests will use that token. These changes also add a new method for calling the `/api/me` endpoint to retrieve the current user.
Configuration menu - View commit details
-
Copy full SHA for 8f74c53 - Browse repository at this point
Copy the full SHA 8f74c53View commit details -
Configuration menu - View commit details
-
Copy full SHA for a34d273 - Browse repository at this point
Copy the full SHA a34d273View commit details -
Add Login, Logout, and Token pages
The Login page has a button that initiates the nmdc-server login using the @capacitor/browser plugin and a new environment variable for the server login route. The Token page is where the backend will redirect to on successful login with the API token in a query parameter. This page collects that token, places it in persistent storage, and redirects to the home page. The Logout page clears the token from persistent storage and redirects to the root page.
Configuration menu - View commit details
-
Copy full SHA for 32f3860 - Browse repository at this point
Copy the full SHA 32f3860View commit details -
Wrap application in new StoreProvider
These changes wrap the main application in the new StoreProvider. The TanStack query setup has also been moved to a dedicated component so that it can use the `useStore` hook to access the store while setting up its persistence layer. Finally, the routing has also moved to a separate component where it also uses the `useStore` hook in order to decide where to redirect the root route. A new AuthRoute component has been added that can be used when registering routes that a user must be logged in (as determined by having an API token in the store) to view.
Configuration menu - View commit details
-
Copy full SHA for a851ec2 - Browse repository at this point
Copy the full SHA a851ec2View commit details -
Display logged-in user on Home page
This is mainly for demo purposes and can be removed later
Configuration menu - View commit details
-
Copy full SHA for 2545479 - Browse repository at this point
Copy the full SHA 2545479View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5372870 - Browse repository at this point
Copy the full SHA 5372870View commit details
Commits on Feb 8, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 28ee324 - Browse repository at this point
Copy the full SHA 28ee324View commit details -
Configuration menu - View commit details
-
Copy full SHA for 850b512 - Browse repository at this point
Copy the full SHA 850b512View commit details -
Configuration menu - View commit details
-
Copy full SHA for 72d3a4e - Browse repository at this point
Copy the full SHA 72d3a4eView commit details -
Configuration menu - View commit details
-
Copy full SHA for d6ee997 - Browse repository at this point
Copy the full SHA d6ee997View commit details -
Configuration menu - View commit details
-
Copy full SHA for 63a4e2f - Browse repository at this point
Copy the full SHA 63a4e2fView commit details
Commits on Feb 9, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 16b63bb - Browse repository at this point
Copy the full SHA 16b63bbView commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.