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
Boilerplate OAuth website <=> inference #2127
Conversation
dbac70c
to
558dafb
Compare
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 for making the required inference backend changes for this!
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.
amazing, thank you!
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.
Nice!
const [provider] = parts as string[]; | ||
const url = process.env.INFERENCE_SERVER_HOST + `/auth/callback/${provider}?code=${code}`; | ||
const { data } = await axios<InferenceTokenResponse>(url); | ||
console.log(data); |
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.
console.log(data); |
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 function is not currently used anywhere, so I left the console log for debugging purposes, I will remove it in the next PR when I integrate it into the API requests.
Refs #2101
Use the website's backend as a callback url for login to discord and github, so that the website also knows the token.
To use this, you need to configure your discord oauth provider to use the url:
http://localhost:3000/api/inference_auth/discord
, I used the same provider I use for logging in to the website and it worked like a charm.github also:
http://localhost:3000/api/inference_auth
orhttp://localhost:3000/api/inference_auth/gihtub
, both should work since github allows sub paths.you need to set these 4 env variables for the inference server:
then you can navigate to