mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-17 07:03:31 +00:00
Add legacy Foundry GitHub callback route
This commit is contained in:
parent
cdac0aa937
commit
436eb4a3a3
1 changed files with 5 additions and 2 deletions
|
|
@ -143,7 +143,7 @@ export async function startBackend(options: BackendStartOptions = {}): Promise<v
|
||||||
return Response.redirect(result.url, 302);
|
return Response.redirect(result.url, 302);
|
||||||
});
|
});
|
||||||
|
|
||||||
app.get("/api/rivet/app/auth/github/callback", async (c) => {
|
const handleGithubAuthCallback = async (c: any) => {
|
||||||
const code = c.req.query("code");
|
const code = c.req.query("code");
|
||||||
const state = c.req.query("state");
|
const state = c.req.query("state");
|
||||||
if (!code || !state) {
|
if (!code || !state) {
|
||||||
|
|
@ -152,7 +152,10 @@ export async function startBackend(options: BackendStartOptions = {}): Promise<v
|
||||||
const result = await appWorkspaceAction(async (workspace) => await workspace.completeAppGithubAuth({ code, state }));
|
const result = await appWorkspaceAction(async (workspace) => await workspace.completeAppGithubAuth({ code, state }));
|
||||||
c.header("x-foundry-session", result.sessionId);
|
c.header("x-foundry-session", result.sessionId);
|
||||||
return Response.redirect(result.redirectTo, 302);
|
return Response.redirect(result.redirectTo, 302);
|
||||||
});
|
};
|
||||||
|
|
||||||
|
app.get("/api/rivet/app/auth/github/callback", handleGithubAuthCallback);
|
||||||
|
app.get("/api/auth/callback/github", handleGithubAuthCallback);
|
||||||
|
|
||||||
app.post("/api/rivet/app/sign-out", async (c) => {
|
app.post("/api/rivet/app/sign-out", async (c) => {
|
||||||
const sessionId = await resolveSessionId(c);
|
const sessionId = await resolveSessionId(c);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue