-
Notifications
You must be signed in to change notification settings - Fork 178
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
feat(opentrons-ai-client): add auth0 package #15148
Conversation
add auth0 package close AUTH-
|
opentrons-ai-client/src/App.tsx
Outdated
// if not authenticated redirect to login page | ||
if (!isAuthenticated) { | ||
window.location.href = LOGIN_PAGE_URL | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You will need to use the button or see if they have a function. Going to the URL is not enough, the package builds a URL using the client id and it also includes where to call back to once authenticated. When I use this locally it works.
<div>
{!isAuthenticated && (
<button onClick={() => loginWithRedirect()}>Log in</button>
)}
</div>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @y3rsh. updated that part.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works for me locally.
* feat(opentrons-ai-client): add auth0 package
* feat(opentrons-ai-client): add auth0 package
Overview
add auth0 package and useAuth0 hook to check the status of authentication and add
logout
button (this is for dev)use getAccessTokenSilently to get access token from Auth0.
https://auth0.com/docs/get-started/applications/confidential-and-public-applications/user-consent-and-third-party-applications
close AUTH-204 AUTH-396
Test Plan
make -C opentrons-ai-client
go to localhost:5173
the browser will be redirected to auth0 login/sign up page
log in (if you don't have an account, please sign up)
check the chat ui is shown
fill out the textarea and click send button
Check the app will receive the output from the BE (this would take some time)
In terms of the response display issue, it will be solved by this pr.
Also I have a refactoring PR to fix current component structure issue (data fetch and token retrieving are done in InputPrompt component)
click logout button
Check when clicking the logout button, the browser will show the login page again
Changelog
Review requests
Risk assessment
low