@kadoa/mcp 0.5.2 → 0.5.3-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +36 -684
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -51500,7 +51500,7 @@ var package_default;
|
|
|
51500
51500
|
var init_package = __esm(() => {
|
|
51501
51501
|
package_default = {
|
|
51502
51502
|
name: "@kadoa/mcp",
|
|
51503
|
-
version: "0.5.
|
|
51503
|
+
version: "0.5.3-rc.1",
|
|
51504
51504
|
description: "Kadoa MCP Server — manage workflows from Claude Desktop, Cursor, and other MCP clients",
|
|
51505
51505
|
type: "module",
|
|
51506
51506
|
main: "dist/index.js",
|
|
@@ -55542,6 +55542,10 @@ function generatePKCE() {
|
|
|
55542
55542
|
const challenge = createHash2("sha256").update(verifier).digest("base64url");
|
|
55543
55543
|
return { verifier, challenge };
|
|
55544
55544
|
}
|
|
55545
|
+
function kadoaAuthUrl() {
|
|
55546
|
+
const raw = process.env.KADOA_AUTH_URL || "https://auth.kadoa.com";
|
|
55547
|
+
return raw.replace(/\/+$/, "");
|
|
55548
|
+
}
|
|
55545
55549
|
function jwtClaims(jwt2) {
|
|
55546
55550
|
try {
|
|
55547
55551
|
const payload = JSON.parse(Buffer.from(jwt2.split(".")[1], "base64url").toString());
|
|
@@ -55554,76 +55558,6 @@ function jwtClaims(jwt2) {
|
|
|
55554
55558
|
return {};
|
|
55555
55559
|
}
|
|
55556
55560
|
}
|
|
55557
|
-
async function exchangeSupabaseCode(code, codeVerifier) {
|
|
55558
|
-
const supabaseUrl = process.env.SUPABASE_URL;
|
|
55559
|
-
if (!supabaseUrl)
|
|
55560
|
-
throw new Error("SUPABASE_URL is not configured");
|
|
55561
|
-
const res = await fetch(`${supabaseUrl}/auth/v1/token?grant_type=pkce`, {
|
|
55562
|
-
method: "POST",
|
|
55563
|
-
headers: {
|
|
55564
|
-
"Content-Type": "application/json",
|
|
55565
|
-
apikey: process.env.SUPABASE_ANON_KEY
|
|
55566
|
-
},
|
|
55567
|
-
body: JSON.stringify({ auth_code: code, code_verifier: codeVerifier })
|
|
55568
|
-
});
|
|
55569
|
-
if (!res.ok) {
|
|
55570
|
-
const body = await res.text();
|
|
55571
|
-
throw new Error(`Supabase token exchange failed (${res.status}): ${body}`);
|
|
55572
|
-
}
|
|
55573
|
-
const data = await res.json();
|
|
55574
|
-
return { accessToken: data.access_token, refreshToken: data.refresh_token };
|
|
55575
|
-
}
|
|
55576
|
-
async function fetchUserTeams(supabaseJwt) {
|
|
55577
|
-
const kadoaApiUrl = process.env.KADOA_PUBLIC_API_URI || "https://api.kadoa.com";
|
|
55578
|
-
const userRes = await fetch(`${kadoaApiUrl}/v4/user`, {
|
|
55579
|
-
headers: { Authorization: `Bearer ${supabaseJwt}` }
|
|
55580
|
-
});
|
|
55581
|
-
if (!userRes.ok) {
|
|
55582
|
-
const body = await userRes.text();
|
|
55583
|
-
throw new Error(`Kadoa /v4/user failed (${userRes.status}): ${body}`);
|
|
55584
|
-
}
|
|
55585
|
-
const userData = await userRes.json();
|
|
55586
|
-
if (!userData.teams?.length) {
|
|
55587
|
-
throw new Error("User has no teams");
|
|
55588
|
-
}
|
|
55589
|
-
return userData.teams.map((t) => ({
|
|
55590
|
-
id: t.id,
|
|
55591
|
-
name: t.name,
|
|
55592
|
-
memberRole: t.memberRole
|
|
55593
|
-
}));
|
|
55594
|
-
}
|
|
55595
|
-
async function setActiveTeamAndRefresh(jwt2, refreshToken, teamId) {
|
|
55596
|
-
const kadoaApiUrl = process.env.KADOA_PUBLIC_API_URI || "https://api.kadoa.com";
|
|
55597
|
-
const supabaseUrl = process.env.SUPABASE_URL;
|
|
55598
|
-
if (!supabaseUrl)
|
|
55599
|
-
throw new Error("SUPABASE_URL is not configured");
|
|
55600
|
-
const setRes = await fetch(`${kadoaApiUrl}/v5/auth/active-team`, {
|
|
55601
|
-
method: "POST",
|
|
55602
|
-
headers: {
|
|
55603
|
-
"Content-Type": "application/json",
|
|
55604
|
-
Authorization: `Bearer ${jwt2}`
|
|
55605
|
-
},
|
|
55606
|
-
body: JSON.stringify({ teamId })
|
|
55607
|
-
});
|
|
55608
|
-
if (!setRes.ok) {
|
|
55609
|
-
const body = await setRes.text();
|
|
55610
|
-
throw new Error(`POST /v5/auth/active-team failed (${setRes.status}): ${body}`);
|
|
55611
|
-
}
|
|
55612
|
-
const refreshRes = await fetch(`${supabaseUrl}/auth/v1/token?grant_type=refresh_token`, {
|
|
55613
|
-
method: "POST",
|
|
55614
|
-
headers: {
|
|
55615
|
-
"Content-Type": "application/json",
|
|
55616
|
-
apikey: process.env.SUPABASE_ANON_KEY
|
|
55617
|
-
},
|
|
55618
|
-
body: JSON.stringify({ refresh_token: refreshToken })
|
|
55619
|
-
});
|
|
55620
|
-
if (!refreshRes.ok) {
|
|
55621
|
-
const body = await refreshRes.text();
|
|
55622
|
-
throw new Error(`Supabase token refresh failed (${refreshRes.status}): ${body}`);
|
|
55623
|
-
}
|
|
55624
|
-
const data = await refreshRes.json();
|
|
55625
|
-
return { jwt: data.access_token, refreshToken: data.refresh_token };
|
|
55626
|
-
}
|
|
55627
55561
|
|
|
55628
55562
|
class KadoaOAuthProvider {
|
|
55629
55563
|
store;
|
|
@@ -55649,151 +55583,23 @@ class KadoaOAuthProvider {
|
|
|
55649
55583
|
};
|
|
55650
55584
|
}
|
|
55651
55585
|
async authorize(client, params, res) {
|
|
55652
|
-
const supabaseUrl = process.env.SUPABASE_URL;
|
|
55653
55586
|
const serverUrl = process.env.MCP_SERVER_URL;
|
|
55654
|
-
if (!
|
|
55655
|
-
throw new Error("
|
|
55656
|
-
}
|
|
55587
|
+
if (!serverUrl)
|
|
55588
|
+
throw new Error("MCP_SERVER_URL must be configured");
|
|
55657
55589
|
const state = randomToken();
|
|
55658
55590
|
const { verifier, challenge } = generatePKCE();
|
|
55659
55591
|
await this.store.set("pending_auths", state, {
|
|
55660
55592
|
client,
|
|
55661
55593
|
params,
|
|
55662
|
-
|
|
55594
|
+
mcpVerifier: verifier
|
|
55663
55595
|
}, 600);
|
|
55664
|
-
|
|
55665
|
-
|
|
55666
|
-
|
|
55667
|
-
|
|
55668
|
-
const pending = await this.store.get("pending_auths", state);
|
|
55669
|
-
if (!pending) {
|
|
55670
|
-
res.status(400).send("Unknown or expired state parameter");
|
|
55671
|
-
return;
|
|
55672
|
-
}
|
|
55673
|
-
const supabaseUrl = process.env.SUPABASE_URL;
|
|
55674
|
-
const serverUrl = process.env.MCP_SERVER_URL;
|
|
55675
|
-
if (!supabaseUrl || !serverUrl) {
|
|
55676
|
-
res.status(500).send("Server misconfigured");
|
|
55677
|
-
return;
|
|
55678
|
-
}
|
|
55679
|
-
const redirectTo = `${serverUrl}/auth/callback?mcp_state=${state}`;
|
|
55680
|
-
const authUrl = new URL(`${supabaseUrl}/auth/v1/authorize`);
|
|
55681
|
-
authUrl.searchParams.set("provider", "google");
|
|
55682
|
-
authUrl.searchParams.set("redirect_to", redirectTo);
|
|
55683
|
-
authUrl.searchParams.set("code_challenge", pending.supabaseCodeVerifier ? createHash2("sha256").update(pending.supabaseCodeVerifier).digest("base64url") : "");
|
|
55596
|
+
const authUrl = new URL(`${kadoaAuthUrl()}/login`);
|
|
55597
|
+
authUrl.searchParams.set("callback_url", `${serverUrl}/auth/callback`);
|
|
55598
|
+
authUrl.searchParams.set("state", state);
|
|
55599
|
+
authUrl.searchParams.set("code_challenge", challenge);
|
|
55684
55600
|
authUrl.searchParams.set("code_challenge_method", "S256");
|
|
55685
55601
|
res.redirect(authUrl.toString());
|
|
55686
55602
|
}
|
|
55687
|
-
async handleEmailPasswordLogin(req, res) {
|
|
55688
|
-
const { state, email: email3, password } = req.body;
|
|
55689
|
-
if (!state || !email3 || !password) {
|
|
55690
|
-
res.status(400).send("Missing required fields");
|
|
55691
|
-
return;
|
|
55692
|
-
}
|
|
55693
|
-
const pending = await this.store.get("pending_auths", state);
|
|
55694
|
-
if (!pending) {
|
|
55695
|
-
res.status(400).type("html").send(renderLoginPage(state, "Session expired — please try again"));
|
|
55696
|
-
return;
|
|
55697
|
-
}
|
|
55698
|
-
const supabaseUrl = process.env.SUPABASE_URL;
|
|
55699
|
-
if (!supabaseUrl) {
|
|
55700
|
-
res.status(500).send("Server misconfigured");
|
|
55701
|
-
return;
|
|
55702
|
-
}
|
|
55703
|
-
try {
|
|
55704
|
-
const tokenRes = await fetch(`${supabaseUrl}/auth/v1/token?grant_type=password`, {
|
|
55705
|
-
method: "POST",
|
|
55706
|
-
headers: {
|
|
55707
|
-
"Content-Type": "application/json",
|
|
55708
|
-
apikey: process.env.SUPABASE_ANON_KEY
|
|
55709
|
-
},
|
|
55710
|
-
body: JSON.stringify({ email: email3, password })
|
|
55711
|
-
});
|
|
55712
|
-
if (!tokenRes.ok) {
|
|
55713
|
-
const body = await tokenRes.json().catch(() => ({ error_description: "Authentication failed" }));
|
|
55714
|
-
const message = body.error_description || body.msg || "Invalid email or password";
|
|
55715
|
-
res.type("html").send(renderLoginPage(state, message));
|
|
55716
|
-
return;
|
|
55717
|
-
}
|
|
55718
|
-
const data = await tokenRes.json();
|
|
55719
|
-
await this.store.del("pending_auths", state);
|
|
55720
|
-
await this.completeAuthWithTokens(pending, res, data.access_token, data.refresh_token);
|
|
55721
|
-
} catch (error48) {
|
|
55722
|
-
console.error("Email/password login error:", error48);
|
|
55723
|
-
res.type("html").send(renderLoginPage(state, "An unexpected error occurred"));
|
|
55724
|
-
}
|
|
55725
|
-
}
|
|
55726
|
-
async handleSSOLogin(req, res) {
|
|
55727
|
-
const { state, email: email3 } = req.body;
|
|
55728
|
-
if (!state || !email3) {
|
|
55729
|
-
res.status(400).send("Missing required fields");
|
|
55730
|
-
return;
|
|
55731
|
-
}
|
|
55732
|
-
const pending = await this.store.get("pending_auths", state);
|
|
55733
|
-
if (!pending) {
|
|
55734
|
-
res.status(400).type("html").send(renderLoginPage(state, "Session expired — please try again"));
|
|
55735
|
-
return;
|
|
55736
|
-
}
|
|
55737
|
-
const supabaseUrl = process.env.SUPABASE_URL;
|
|
55738
|
-
const serverUrl = process.env.MCP_SERVER_URL;
|
|
55739
|
-
if (!supabaseUrl || !serverUrl) {
|
|
55740
|
-
res.status(500).send("Server misconfigured");
|
|
55741
|
-
return;
|
|
55742
|
-
}
|
|
55743
|
-
const domain2 = email3.includes("@") ? email3.split("@").pop() : email3;
|
|
55744
|
-
try {
|
|
55745
|
-
const ssoRes = await fetch(`${supabaseUrl}/auth/v1/sso`, {
|
|
55746
|
-
method: "POST",
|
|
55747
|
-
headers: {
|
|
55748
|
-
"Content-Type": "application/json",
|
|
55749
|
-
apikey: process.env.SUPABASE_ANON_KEY
|
|
55750
|
-
},
|
|
55751
|
-
body: JSON.stringify({
|
|
55752
|
-
domain: domain2,
|
|
55753
|
-
redirect_to: `${serverUrl}/auth/callback?mcp_state=${state}`,
|
|
55754
|
-
skip_http_redirect: true,
|
|
55755
|
-
code_challenge: createHash2("sha256").update(pending.supabaseCodeVerifier).digest("base64url"),
|
|
55756
|
-
code_challenge_method: "s256"
|
|
55757
|
-
})
|
|
55758
|
-
});
|
|
55759
|
-
if (!ssoRes.ok) {
|
|
55760
|
-
const body = await ssoRes.json().catch(() => ({}));
|
|
55761
|
-
const message = body.error_description || body.msg || body.message || "No SSO provider configured for this domain";
|
|
55762
|
-
res.type("html").send(renderLoginPage(state, message));
|
|
55763
|
-
return;
|
|
55764
|
-
}
|
|
55765
|
-
const data = await ssoRes.json();
|
|
55766
|
-
if (!data.url) {
|
|
55767
|
-
res.type("html").send(renderLoginPage(state, "No SSO provider configured for this domain"));
|
|
55768
|
-
return;
|
|
55769
|
-
}
|
|
55770
|
-
res.redirect(data.url);
|
|
55771
|
-
} catch (error48) {
|
|
55772
|
-
console.error("SSO login error:", error48);
|
|
55773
|
-
res.type("html").send(renderLoginPage(state, "An unexpected error occurred"));
|
|
55774
|
-
}
|
|
55775
|
-
}
|
|
55776
|
-
async completeAuthWithTokens(pending, res, supabaseJwt, supabaseRefreshToken) {
|
|
55777
|
-
const teams = await fetchUserTeams(supabaseJwt);
|
|
55778
|
-
if (teams.length === 1) {
|
|
55779
|
-
const refreshed = await setActiveTeamAndRefresh(supabaseJwt, supabaseRefreshToken, teams[0].id);
|
|
55780
|
-
await this.completeAuthFlow(pending, res, {
|
|
55781
|
-
jwt: refreshed.jwt,
|
|
55782
|
-
refreshToken: refreshed.refreshToken,
|
|
55783
|
-
teamId: teams[0].id
|
|
55784
|
-
});
|
|
55785
|
-
return;
|
|
55786
|
-
}
|
|
55787
|
-
const selectionToken = randomToken();
|
|
55788
|
-
await this.store.set("pending_team_selections", selectionToken, {
|
|
55789
|
-
supabaseJwt,
|
|
55790
|
-
supabaseRefreshToken,
|
|
55791
|
-
teams,
|
|
55792
|
-
pending,
|
|
55793
|
-
expiresAt: Date.now() + TEAM_SELECTION_TTL
|
|
55794
|
-
}, 600);
|
|
55795
|
-
res.type("html").send(renderTeamSelectionPage(teams, selectionToken));
|
|
55796
|
-
}
|
|
55797
55603
|
async challengeForAuthorizationCode(_client, authorizationCode) {
|
|
55798
55604
|
const entry = await this.store.get("auth_codes", authorizationCode);
|
|
55799
55605
|
if (!entry)
|
|
@@ -55918,9 +55724,9 @@ class KadoaOAuthProvider {
|
|
|
55918
55724
|
};
|
|
55919
55725
|
}
|
|
55920
55726
|
async handleAuthCallback(req, res) {
|
|
55921
|
-
const { code,
|
|
55727
|
+
const { code, state } = req.query;
|
|
55922
55728
|
if (!code || !state) {
|
|
55923
|
-
res.status(400).send("Missing code or
|
|
55729
|
+
res.status(400).send("Missing code or state parameter");
|
|
55924
55730
|
return;
|
|
55925
55731
|
}
|
|
55926
55732
|
const pending = await this.store.get("pending_auths", state);
|
|
@@ -55930,10 +55736,28 @@ class KadoaOAuthProvider {
|
|
|
55930
55736
|
}
|
|
55931
55737
|
await this.store.del("pending_auths", state);
|
|
55932
55738
|
try {
|
|
55933
|
-
const
|
|
55934
|
-
|
|
55739
|
+
const tokenRes = await fetch(`${kadoaAuthUrl()}/api/token`, {
|
|
55740
|
+
method: "POST",
|
|
55741
|
+
headers: { "Content-Type": "application/json" },
|
|
55742
|
+
body: JSON.stringify({ code, code_verifier: pending.mcpVerifier })
|
|
55743
|
+
});
|
|
55744
|
+
if (!tokenRes.ok) {
|
|
55745
|
+
const body = await tokenRes.text().catch(() => "");
|
|
55746
|
+
throw new Error(`auth.kadoa.com /api/token failed (${tokenRes.status}): ${body}`);
|
|
55747
|
+
}
|
|
55748
|
+
const data = await tokenRes.json();
|
|
55749
|
+
if (typeof data?.access_token !== "string" || typeof data?.refresh_token !== "string" || typeof data?.team_id !== "string") {
|
|
55750
|
+
throw new Error("auth.kadoa.com /api/token returned malformed response");
|
|
55751
|
+
}
|
|
55752
|
+
const claims = jwtClaims(data.access_token);
|
|
55753
|
+
console.error(`[AUTH] CALLBACK_OK: tokens received (email=${claims.email}, team=${data.team_id})`);
|
|
55754
|
+
await this.completeAuthFlow(pending, res, {
|
|
55755
|
+
jwt: data.access_token,
|
|
55756
|
+
refreshToken: data.refresh_token,
|
|
55757
|
+
teamId: data.team_id
|
|
55758
|
+
});
|
|
55935
55759
|
} catch (error48) {
|
|
55936
|
-
console.error("
|
|
55760
|
+
console.error("[AUTH] CALLBACK_FAIL:", error48);
|
|
55937
55761
|
const redirectUrl = new URL(pending.params.redirectUri);
|
|
55938
55762
|
redirectUrl.searchParams.set("error", "server_error");
|
|
55939
55763
|
redirectUrl.searchParams.set("error_description", error48 instanceof Error ? error48.message : "Authentication failed");
|
|
@@ -55943,45 +55767,6 @@ class KadoaOAuthProvider {
|
|
|
55943
55767
|
res.redirect(redirectUrl.toString());
|
|
55944
55768
|
}
|
|
55945
55769
|
}
|
|
55946
|
-
async handleTeamSelection(req, res) {
|
|
55947
|
-
const { token, teamId } = req.body;
|
|
55948
|
-
if (!token || !teamId) {
|
|
55949
|
-
res.status(400).send("Missing token or teamId");
|
|
55950
|
-
return;
|
|
55951
|
-
}
|
|
55952
|
-
const entry = await this.store.get("pending_team_selections", token);
|
|
55953
|
-
if (!entry) {
|
|
55954
|
-
res.status(400).send("Unknown or expired team selection token");
|
|
55955
|
-
return;
|
|
55956
|
-
}
|
|
55957
|
-
if (entry.expiresAt < Date.now()) {
|
|
55958
|
-
await this.store.del("pending_team_selections", token);
|
|
55959
|
-
res.status(400).send("Team selection expired — please log in again");
|
|
55960
|
-
return;
|
|
55961
|
-
}
|
|
55962
|
-
if (!entry.teams.some((t) => t.id === teamId)) {
|
|
55963
|
-
res.status(403).send("Invalid team selection");
|
|
55964
|
-
return;
|
|
55965
|
-
}
|
|
55966
|
-
await this.store.del("pending_team_selections", token);
|
|
55967
|
-
try {
|
|
55968
|
-
const refreshed = await setActiveTeamAndRefresh(entry.supabaseJwt, entry.supabaseRefreshToken, teamId);
|
|
55969
|
-
await this.completeAuthFlow(entry.pending, res, {
|
|
55970
|
-
jwt: refreshed.jwt,
|
|
55971
|
-
refreshToken: refreshed.refreshToken,
|
|
55972
|
-
teamId
|
|
55973
|
-
});
|
|
55974
|
-
} catch (error48) {
|
|
55975
|
-
console.error("Team selection error:", error48);
|
|
55976
|
-
const redirectUrl = new URL(entry.pending.params.redirectUri);
|
|
55977
|
-
redirectUrl.searchParams.set("error", "server_error");
|
|
55978
|
-
redirectUrl.searchParams.set("error_description", error48 instanceof Error ? error48.message : "Failed to set active team");
|
|
55979
|
-
if (entry.pending.params.state) {
|
|
55980
|
-
redirectUrl.searchParams.set("state", entry.pending.params.state);
|
|
55981
|
-
}
|
|
55982
|
-
res.redirect(redirectUrl.toString());
|
|
55983
|
-
}
|
|
55984
|
-
}
|
|
55985
55770
|
async completeAuthFlow(pending, res, credentials) {
|
|
55986
55771
|
const mcpCode = randomToken();
|
|
55987
55772
|
await this.store.set("auth_codes", mcpCode, {
|
|
@@ -56001,429 +55786,9 @@ class KadoaOAuthProvider {
|
|
|
56001
55786
|
res.redirect(redirectUrl.toString());
|
|
56002
55787
|
}
|
|
56003
55788
|
}
|
|
56004
|
-
|
|
56005
|
-
const teamButtons = teams.map((t) => `
|
|
56006
|
-
<button type="submit" name="teamId" value="${t.id}" class="team-btn">
|
|
56007
|
-
<span class="team-name">${escapeHtml(t.name)}</span>
|
|
56008
|
-
${t.memberRole ? `<span class="team-role">${escapeHtml(t.memberRole.toLowerCase())}</span>` : ""}
|
|
56009
|
-
</button>`).join(`
|
|
56010
|
-
`);
|
|
56011
|
-
return `<!DOCTYPE html>
|
|
56012
|
-
<html lang="en">
|
|
56013
|
-
<head>
|
|
56014
|
-
<meta charset="utf-8" />
|
|
56015
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
56016
|
-
<title>Select Team - Kadoa</title>
|
|
56017
|
-
<style>
|
|
56018
|
-
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
56019
|
-
|
|
56020
|
-
body {
|
|
56021
|
-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
56022
|
-
background: oklch(1 0 0);
|
|
56023
|
-
color: oklch(0.17 0.02 228);
|
|
56024
|
-
min-height: 100vh;
|
|
56025
|
-
display: flex;
|
|
56026
|
-
align-items: center;
|
|
56027
|
-
justify-content: center;
|
|
56028
|
-
}
|
|
56029
|
-
|
|
56030
|
-
.container {
|
|
56031
|
-
width: 100%;
|
|
56032
|
-
max-width: 420px;
|
|
56033
|
-
padding: 2rem;
|
|
56034
|
-
}
|
|
56035
|
-
|
|
56036
|
-
.logo {
|
|
56037
|
-
text-align: center;
|
|
56038
|
-
margin-bottom: 2rem;
|
|
56039
|
-
}
|
|
56040
|
-
|
|
56041
|
-
h1 {
|
|
56042
|
-
font-size: 1.25rem;
|
|
56043
|
-
font-weight: 600;
|
|
56044
|
-
text-align: center;
|
|
56045
|
-
margin-bottom: 0.5rem;
|
|
56046
|
-
color: oklch(0.17 0.02 228);
|
|
56047
|
-
}
|
|
56048
|
-
|
|
56049
|
-
.subtitle {
|
|
56050
|
-
text-align: center;
|
|
56051
|
-
color: oklch(0.56 0.02 228);
|
|
56052
|
-
font-size: 0.875rem;
|
|
56053
|
-
margin-bottom: 1.5rem;
|
|
56054
|
-
}
|
|
56055
|
-
|
|
56056
|
-
.team-btn {
|
|
56057
|
-
width: 100%;
|
|
56058
|
-
display: flex;
|
|
56059
|
-
align-items: center;
|
|
56060
|
-
justify-content: space-between;
|
|
56061
|
-
padding: 0.875rem 1rem;
|
|
56062
|
-
margin-bottom: 0.5rem;
|
|
56063
|
-
background: oklch(1 0 0);
|
|
56064
|
-
border: 1px solid oklch(0.5 0.02 228 / 0.4);
|
|
56065
|
-
border-radius: 0.3rem;
|
|
56066
|
-
color: oklch(0.17 0.02 228);
|
|
56067
|
-
font-size: 15px;
|
|
56068
|
-
cursor: pointer;
|
|
56069
|
-
transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
|
|
56070
|
-
box-shadow: 0px 1px 1px 0px oklch(0.68 0.01 60.13 / 0.11);
|
|
56071
|
-
}
|
|
56072
|
-
|
|
56073
|
-
.team-btn:hover {
|
|
56074
|
-
background: oklch(0.96 0 286);
|
|
56075
|
-
border-color: oklch(0.7 0.18 42);
|
|
56076
|
-
}
|
|
56077
|
-
|
|
56078
|
-
.team-btn:active {
|
|
56079
|
-
background: oklch(0.72 0.23 54 / 0.13);
|
|
56080
|
-
}
|
|
56081
|
-
|
|
56082
|
-
.team-name { font-weight: 500; }
|
|
56083
|
-
|
|
56084
|
-
.team-role {
|
|
56085
|
-
font-size: 13px;
|
|
56086
|
-
color: oklch(0.56 0.02 228 / 0.67);
|
|
56087
|
-
text-transform: capitalize;
|
|
56088
|
-
}
|
|
56089
|
-
</style>
|
|
56090
|
-
</head>
|
|
56091
|
-
<body>
|
|
56092
|
-
<div class="container">
|
|
56093
|
-
<div class="logo">
|
|
56094
|
-
<svg width="108" height="32" viewBox="0 0 108 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
56095
|
-
<g clip-path="url(#clip0)">
|
|
56096
|
-
<path d="M4.5 27V20.0059C4.49955 18.6288 3.38499 17.5105 2.00781 17.5059L-0.00585938 17.5V14.5L2.00781 14.4941C3.38499 14.4895 4.49955 13.3712 4.5 11.9941V5C4.5 2.51472 6.51472 0.5 9 0.5H12V3.5H9C8.17157 3.5 7.5 4.17157 7.5 5V11.9941C7.49977 13.5757 6.82719 14.9966 5.75781 16C6.82719 17.0034 7.49977 18.4243 7.5 20.0059V27C7.5 27.8284 8.17157 28.5 9 28.5H12V31.5H9C6.51472 31.5 4.5 29.4853 4.5 27Z" fill="#FD7412"/>
|
|
56097
|
-
<path d="M103.5 27V20.0059C103.5 18.6288 104.615 17.5105 105.992 17.5059L108.006 17.5V14.5L105.992 14.4941C104.615 14.4895 103.5 13.3712 103.5 11.9941V5C103.5 2.51472 101.485 0.5 99 0.5H96V3.5H99C99.8284 3.5 100.5 4.17157 100.5 5V11.9941C100.5 13.5757 101.173 14.9966 102.242 16C101.173 17.0034 100.5 18.4243 100.5 20.0059V27C100.5 27.8284 99.8284 28.5 99 28.5H96V31.5H99C101.485 31.5 103.5 29.4853 103.5 27Z" fill="#FD7412"/>
|
|
56098
|
-
<path d="M85.2346 26.308C84.0026 26.308 82.92 26.0093 81.9866 25.412C81.0533 24.8147 80.3253 23.9653 79.8026 22.864C79.28 21.7627 79.0186 20.4373 79.0186 18.888C79.0186 17.3573 79.28 16.0413 79.8026 14.94C80.3253 13.8387 81.0533 12.9987 81.9866 12.42C82.92 11.8227 84.0026 11.524 85.2346 11.524C86.3733 11.524 87.3906 11.804 88.2866 12.364C89.2013 12.9053 89.7986 13.6427 90.0786 14.576H89.7706L90.1066 11.804H94.1666C94.1106 12.42 94.0546 13.0453 93.9986 13.68C93.9613 14.296 93.9426 14.9027 93.9426 15.5V26H89.7426L89.7146 23.34H90.0506C89.752 24.236 89.1546 24.9547 88.2586 25.496C87.3626 26.0373 86.3546 26.308 85.2346 26.308ZM86.5226 23.116C87.4933 23.116 88.2773 22.7707 88.8746 22.08C89.472 21.3893 89.7706 20.3253 89.7706 18.888C89.7706 17.4507 89.472 16.396 88.8746 15.724C88.2773 15.052 87.4933 14.716 86.5226 14.716C85.552 14.716 84.768 15.052 84.1706 15.724C83.5733 16.396 83.2746 17.4507 83.2746 18.888C83.2746 20.3253 83.564 21.3893 84.1426 22.08C84.74 22.7707 85.5333 23.116 86.5226 23.116Z" fill="#18181B"/>
|
|
56099
|
-
<path d="M70.1002 26.308C68.5882 26.308 67.2722 26.0093 66.1522 25.412C65.0509 24.796 64.1922 23.9373 63.5762 22.836C62.9789 21.7347 62.6802 20.4187 62.6802 18.888C62.6802 17.376 62.9789 16.0693 63.5762 14.968C64.1922 13.8667 65.0509 13.0173 66.1522 12.42C67.2722 11.8227 68.5882 11.524 70.1002 11.524C71.6122 11.524 72.9282 11.8227 74.0482 12.42C75.1682 13.0173 76.0269 13.8667 76.6242 14.968C77.2402 16.0693 77.5482 17.376 77.5482 18.888C77.5482 20.4187 77.2402 21.7347 76.6242 22.836C76.0269 23.9373 75.1682 24.796 74.0482 25.412C72.9282 26.0093 71.6122 26.308 70.1002 26.308ZM70.1002 23.116C71.0709 23.116 71.8362 22.7707 72.3962 22.08C72.9749 21.3893 73.2642 20.3253 73.2642 18.888C73.2642 17.4507 72.9749 16.396 72.3962 15.724C71.8362 15.052 71.0709 14.716 70.1002 14.716C69.1295 14.716 68.3549 15.052 67.7762 15.724C67.2162 16.396 66.9362 17.4507 66.9362 18.888C66.9362 20.3253 67.2162 21.3893 67.7762 22.08C68.3549 22.7707 69.1295 23.116 70.1002 23.116Z" fill="#18181B"/>
|
|
56100
|
-
<path d="M51.8208 26.308C50.5888 26.308 49.4968 26.0093 48.5448 25.412C47.6115 24.8147 46.8741 23.9653 46.3328 22.864C45.8101 21.7627 45.5488 20.4373 45.5488 18.888C45.5488 17.3573 45.8101 16.0413 46.3328 14.94C46.8555 13.8387 47.5928 12.9987 48.5448 12.42C49.4968 11.8227 50.5888 11.524 51.8208 11.524C52.9408 11.524 53.9395 11.7947 54.8168 12.336C55.7128 12.8587 56.3101 13.568 56.6088 14.464H56.2448V5.392H60.4728V26H56.3008V23.228H56.6648C56.3661 24.1613 55.7688 24.908 54.8728 25.468C53.9768 26.028 52.9595 26.308 51.8208 26.308ZM53.0808 23.116C54.0515 23.116 54.8355 22.7707 55.4328 22.08C56.0301 21.3893 56.3288 20.3253 56.3288 18.888C56.3288 17.4507 56.0301 16.396 55.4328 15.724C54.8355 15.052 54.0515 14.716 53.0808 14.716C52.1101 14.716 51.3168 15.052 50.7008 15.724C50.1035 16.396 49.8048 17.4507 49.8048 18.888C49.8048 20.3253 50.1035 21.3893 50.7008 22.08C51.3168 22.7707 52.1101 23.116 53.0808 23.116Z" fill="#18181B"/>
|
|
56101
|
-
<path d="M34.6334 26.308C33.4014 26.308 32.3187 26.0093 31.3854 25.412C30.4521 24.8147 29.7241 23.9653 29.2014 22.864C28.6787 21.7627 28.4174 20.4373 28.4174 18.888C28.4174 17.3573 28.6787 16.0413 29.2014 14.94C29.7241 13.8387 30.4521 12.9987 31.3854 12.42C32.3187 11.8227 33.4014 11.524 34.6334 11.524C35.7721 11.524 36.7894 11.804 37.6854 12.364C38.6001 12.9053 39.1974 13.6427 39.4774 14.576H39.1694L39.5054 11.804H43.5654C43.5094 12.42 43.4534 13.0453 43.3974 13.68C43.3601 14.296 43.3414 14.9027 43.3414 15.5V26H39.1414L39.1134 23.34H39.4494C39.1507 24.236 38.5534 24.9547 37.6574 25.496C36.7614 26.0373 35.7534 26.308 34.6334 26.308ZM35.9214 23.116C36.8921 23.116 37.6761 22.7707 38.2734 22.08C38.8707 21.3893 39.1694 20.3253 39.1694 18.888C39.1694 17.4507 38.8707 16.396 38.2734 15.724C37.6761 15.052 36.8921 14.716 35.9214 14.716C34.9507 14.716 34.1667 15.052 33.5694 15.724C32.9721 16.396 32.6734 17.4507 32.6734 18.888C32.6734 20.3253 32.9627 21.3893 33.5414 22.08C34.1387 22.7707 34.9321 23.116 35.9214 23.116Z" fill="#18181B"/>
|
|
56102
|
-
<path d="M13.736 26V5.392H17.964V17.712H18.02L23.284 11.804H28.324L21.52 19.364V17.824L28.688 26H23.508L18.02 19.84H17.964V26H13.736Z" fill="#18181B"/>
|
|
56103
|
-
</g>
|
|
56104
|
-
<defs><clipPath id="clip0"><rect width="108" height="32" fill="white"/></clipPath></defs>
|
|
56105
|
-
</svg>
|
|
56106
|
-
</div>
|
|
56107
|
-
<h1>Select a team</h1>
|
|
56108
|
-
<p class="subtitle">Choose which team to connect with this MCP session</p>
|
|
56109
|
-
<form method="POST" action="/team-select">
|
|
56110
|
-
<input type="hidden" name="token" value="${selectionToken}" />
|
|
56111
|
-
${teamButtons}
|
|
56112
|
-
</form>
|
|
56113
|
-
</div>
|
|
56114
|
-
</body>
|
|
56115
|
-
</html>`;
|
|
56116
|
-
}
|
|
56117
|
-
function renderLoginPage(state, error48) {
|
|
56118
|
-
const errorHtml = error48 ? `<div class="error">${escapeHtml(error48)}</div>` : "";
|
|
56119
|
-
return `<!DOCTYPE html>
|
|
56120
|
-
<html lang="en">
|
|
56121
|
-
<head>
|
|
56122
|
-
<meta charset="utf-8" />
|
|
56123
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
56124
|
-
<title>Sign In - Kadoa</title>
|
|
56125
|
-
<style>
|
|
56126
|
-
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
56127
|
-
|
|
56128
|
-
body {
|
|
56129
|
-
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
56130
|
-
background: hsl(0 0% 98%);
|
|
56131
|
-
color: #18181b;
|
|
56132
|
-
min-height: 100dvh;
|
|
56133
|
-
display: flex;
|
|
56134
|
-
align-items: center;
|
|
56135
|
-
justify-content: center;
|
|
56136
|
-
background-image: radial-gradient(circle, #d4d4d8 1px, transparent 1px);
|
|
56137
|
-
background-size: 24px 24px;
|
|
56138
|
-
background-position: center top;
|
|
56139
|
-
}
|
|
56140
|
-
|
|
56141
|
-
.card {
|
|
56142
|
-
width: 100%;
|
|
56143
|
-
max-width: 460px;
|
|
56144
|
-
background: #fff;
|
|
56145
|
-
padding: 1rem;
|
|
56146
|
-
display: flex;
|
|
56147
|
-
flex-direction: column;
|
|
56148
|
-
gap: 1rem;
|
|
56149
|
-
min-height: 100dvh;
|
|
56150
|
-
}
|
|
56151
|
-
|
|
56152
|
-
@media (min-width: 768px) {
|
|
56153
|
-
.card { padding: 3rem; min-height: auto; border-left: 1px solid #e0e1e5; border-right: 1px solid #e0e1e5; }
|
|
56154
|
-
}
|
|
56155
|
-
|
|
56156
|
-
.logo { display: grid; place-content: center; }
|
|
56157
|
-
|
|
56158
|
-
h1 {
|
|
56159
|
-
font-size: 20px;
|
|
56160
|
-
font-weight: 600;
|
|
56161
|
-
text-align: center;
|
|
56162
|
-
color: #18181b;
|
|
56163
|
-
}
|
|
56164
|
-
|
|
56165
|
-
.spacer { height: 0; }
|
|
56166
|
-
@media (min-width: 768px) { .spacer { height: 3rem; } }
|
|
56167
|
-
|
|
56168
|
-
.error {
|
|
56169
|
-
background: #fef2f2;
|
|
56170
|
-
color: #991b1b;
|
|
56171
|
-
border: 1px solid #fecaca;
|
|
56172
|
-
border-radius: 4px;
|
|
56173
|
-
padding: 0.6rem 0.875rem;
|
|
56174
|
-
font-size: 15px;
|
|
56175
|
-
}
|
|
56176
|
-
|
|
56177
|
-
/* Buttons — matching KUI default + primary looks */
|
|
56178
|
-
.btn {
|
|
56179
|
-
width: 100%;
|
|
56180
|
-
padding: 0.6em 1em;
|
|
56181
|
-
border-radius: 4px;
|
|
56182
|
-
font-size: 16px;
|
|
56183
|
-
font-weight: 500;
|
|
56184
|
-
cursor: pointer;
|
|
56185
|
-
display: flex;
|
|
56186
|
-
align-items: center;
|
|
56187
|
-
justify-content: center;
|
|
56188
|
-
gap: 0.5rem;
|
|
56189
|
-
transition: background 0.15s, border-color 0.15s;
|
|
56190
|
-
text-decoration: none;
|
|
56191
|
-
}
|
|
56192
|
-
|
|
56193
|
-
.btn-default {
|
|
56194
|
-
background: #fff;
|
|
56195
|
-
color: #18181b;
|
|
56196
|
-
border: 1px solid #d4d4d8;
|
|
56197
|
-
box-shadow: inset 0 -3px 0 0 rgba(0,0,0,0.03), 0 1px 0px 1px rgba(255,255,255,0.5), 0 -1px 0px 1px rgba(0,0,0,0.02);
|
|
56198
|
-
}
|
|
56199
|
-
|
|
56200
|
-
.btn-default:hover {
|
|
56201
|
-
background: rgba(113,113,122,0.1);
|
|
56202
|
-
}
|
|
56203
|
-
|
|
56204
|
-
.btn-primary {
|
|
56205
|
-
background: hsl(212 70% 27%);
|
|
56206
|
-
color: #fff;
|
|
56207
|
-
border: 1px solid hsl(214 70% 23%);
|
|
56208
|
-
box-shadow: inset 0 2px 0 0 rgba(56,189,248,0.2), 0 -1px 0px 1px rgba(0,0,0,0.02);
|
|
56209
|
-
}
|
|
56210
|
-
|
|
56211
|
-
.btn-primary:hover {
|
|
56212
|
-
background: hsl(212 70% 33%);
|
|
56213
|
-
}
|
|
56214
|
-
|
|
56215
|
-
/* OR divider */
|
|
56216
|
-
.line-or {
|
|
56217
|
-
display: flex;
|
|
56218
|
-
align-items: center;
|
|
56219
|
-
gap: 0.5rem;
|
|
56220
|
-
font-weight: 500;
|
|
56221
|
-
color: rgba(24,24,27,0.6);
|
|
56222
|
-
font-size: 14px;
|
|
56223
|
-
margin: 0.5rem 0;
|
|
56224
|
-
}
|
|
56225
|
-
|
|
56226
|
-
.line-or hr {
|
|
56227
|
-
flex: 1;
|
|
56228
|
-
border: none;
|
|
56229
|
-
border-top: 1px solid rgba(113,113,122,0.15);
|
|
56230
|
-
}
|
|
56231
|
-
|
|
56232
|
-
/* Form inputs — matching KUI input style */
|
|
56233
|
-
label {
|
|
56234
|
-
display: block;
|
|
56235
|
-
font-size: 16px;
|
|
56236
|
-
font-weight: 500;
|
|
56237
|
-
margin-bottom: 0.25rem;
|
|
56238
|
-
color: #18181b;
|
|
56239
|
-
}
|
|
56240
|
-
|
|
56241
|
-
input[type="email"], input[type="password"] {
|
|
56242
|
-
width: 100%;
|
|
56243
|
-
padding: 0.35em 0.5em;
|
|
56244
|
-
border: 1px solid #d4d4d8;
|
|
56245
|
-
border-radius: 4px;
|
|
56246
|
-
font-size: 18px;
|
|
56247
|
-
font-family: inherit;
|
|
56248
|
-
color: #18181b;
|
|
56249
|
-
background: #fff;
|
|
56250
|
-
outline: none;
|
|
56251
|
-
box-shadow: inset 0 3px 0 0 rgba(0,0,0,0.025);
|
|
56252
|
-
transition: border-color 0.15s;
|
|
56253
|
-
caret-color: hsl(25 98% 53%);
|
|
56254
|
-
}
|
|
56255
|
-
|
|
56256
|
-
input[type="email"]:hover, input[type="password"]:hover {
|
|
56257
|
-
border-color: hsl(31 99% 72%);
|
|
56258
|
-
}
|
|
56259
|
-
|
|
56260
|
-
input[type="email"]:focus, input[type="password"]:focus {
|
|
56261
|
-
border-color: hsl(25 98% 53%);
|
|
56262
|
-
box-shadow: inset 0 3px 0 0 rgba(0,0,0,0.025), 0 0 0 2px rgba(249,115,22,0.2);
|
|
56263
|
-
}
|
|
56264
|
-
|
|
56265
|
-
.field { margin-bottom: 0.75rem; }
|
|
56266
|
-
|
|
56267
|
-
hr.separator {
|
|
56268
|
-
border: none;
|
|
56269
|
-
border-top: 1px solid rgba(113,113,122,0.15);
|
|
56270
|
-
margin: 0.5rem 0;
|
|
56271
|
-
}
|
|
56272
|
-
|
|
56273
|
-
.google-icon { width: 18px; height: 18px; }
|
|
56274
|
-
.key-icon { width: 16px; height: 16px; }
|
|
56275
|
-
|
|
56276
|
-
/* Tabs for email/SSO — keep simple, same visual weight */
|
|
56277
|
-
.tabs {
|
|
56278
|
-
display: none;
|
|
56279
|
-
}
|
|
56280
|
-
|
|
56281
|
-
.tab-content { display: none; }
|
|
56282
|
-
.tab-content.active { display: block; }
|
|
56283
|
-
|
|
56284
|
-
.tab-switch {
|
|
56285
|
-
text-align: center;
|
|
56286
|
-
margin-top: 0.25rem;
|
|
56287
|
-
}
|
|
56288
|
-
|
|
56289
|
-
.tab-switch a {
|
|
56290
|
-
font-size: 15px;
|
|
56291
|
-
color: #18181b;
|
|
56292
|
-
text-decoration: underline;
|
|
56293
|
-
text-decoration-color: rgba(251,146,60,0.5);
|
|
56294
|
-
text-underline-offset: 2px;
|
|
56295
|
-
cursor: pointer;
|
|
56296
|
-
}
|
|
56297
|
-
|
|
56298
|
-
.tab-switch a:hover {
|
|
56299
|
-
background: rgba(251,146,60,0.1);
|
|
56300
|
-
border-radius: 2px;
|
|
56301
|
-
}
|
|
56302
|
-
</style>
|
|
56303
|
-
</head>
|
|
56304
|
-
<body>
|
|
56305
|
-
<div class="card">
|
|
56306
|
-
<!-- Logo {k} -->
|
|
56307
|
-
<div class="logo">
|
|
56308
|
-
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
56309
|
-
<path opacity="0.15" d="M25.3196 6.25H14.6804C14.6804 7.49264 13.6596 8.5 12.4005 8.5C11.3808 8.5 10.8312 8.67478 10.5466 8.82497C10.3001 8.95506 10.147 9.11941 10.0189 9.38005C9.85482 9.7141 9.74438 10.1712 9.68281 10.8152C9.62136 11.458 9.61405 12.2133 9.61405 13.125L9.61416 13.3731C9.61532 14.9118 9.61694 17.0733 8.75235 18.8332C8.55109 19.2428 8.30266 19.6357 8 20C8.30266 20.3643 8.55109 20.7572 8.75235 21.1668C9.61694 22.9267 9.61532 25.0882 9.61416 26.6269L9.61405 26.875C9.61405 27.7867 9.62136 28.542 9.68281 29.1848C9.74438 29.8288 9.85482 30.2859 10.0189 30.6199C10.147 30.8806 10.3001 31.0449 10.5466 31.175C10.8312 31.3252 11.3808 31.5 12.4005 31.5C13.6596 31.5 14.6804 32.5074 14.6804 33.75H25.3196C25.3196 32.5074 26.3404 31.5 27.5995 31.5C28.6192 31.5 29.1688 31.3252 29.4534 31.175C29.6999 31.0449 29.853 30.8806 29.9811 30.6199C30.1452 30.2859 30.2556 29.8288 30.3172 29.1848C30.3786 28.542 30.386 27.7867 30.386 26.875L30.3858 26.6269C30.3847 25.0882 30.3831 22.9267 31.2477 21.1668C31.4489 20.7572 31.6973 20.3643 32 20C31.6973 19.6357 31.4489 19.2428 31.2477 18.8332C30.3831 17.0733 30.3847 14.9118 30.3858 13.3731L30.386 13.125C30.386 12.2133 30.3786 11.458 30.3172 10.8152C30.2556 10.1712 30.1452 9.7141 29.9811 9.38005C29.853 9.11941 29.6999 8.95506 29.4534 8.82497C29.1688 8.67478 28.6192 8.5 27.5995 8.5C26.3404 8.5 25.3196 7.49264 25.3196 6.25Z" fill="#fd7412"/>
|
|
56310
|
-
<path d="M12.5 6.25C2.5 6.25 12.5 20 2.5 20C12.5 20 2.5 33.75 12.5 33.75" stroke="#fd7412" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8"/>
|
|
56311
|
-
<path d="M16 10V29" stroke="#18181B" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8"/>
|
|
56312
|
-
<path d="M27.5 6.25C37.5 6.25 27.5 20 37.5 20C27.5 20 37.5 33.75 27.5 33.75" stroke="#fd7412" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8"/>
|
|
56313
|
-
<path d="M16 23L25 18" stroke="#18181B" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8"/>
|
|
56314
|
-
<path d="M25 29L16 23" stroke="#18181B" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8"/>
|
|
56315
|
-
</svg>
|
|
56316
|
-
</div>
|
|
56317
|
-
|
|
56318
|
-
<!-- Heading -->
|
|
56319
|
-
<h1>Sign in to Kadoa</h1>
|
|
56320
|
-
|
|
56321
|
-
<div class="spacer"></div>
|
|
56322
|
-
|
|
56323
|
-
${errorHtml}
|
|
56324
|
-
|
|
56325
|
-
<!-- Continue with Google -->
|
|
56326
|
-
<form method="POST" action="/auth/google">
|
|
56327
|
-
<input type="hidden" name="state" value="${escapeHtml(state)}" />
|
|
56328
|
-
<button type="submit" class="btn btn-default">
|
|
56329
|
-
<svg class="google-icon" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
56330
|
-
<path d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z" fill="#4285F4"/>
|
|
56331
|
-
<path d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z" fill="#34A853"/>
|
|
56332
|
-
<path d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z" fill="#FBBC05"/>
|
|
56333
|
-
<path d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z" fill="#EA4335"/>
|
|
56334
|
-
</svg>
|
|
56335
|
-
Continue with Google
|
|
56336
|
-
</button>
|
|
56337
|
-
</form>
|
|
56338
|
-
|
|
56339
|
-
<!-- Continue with SSO -->
|
|
56340
|
-
<div id="sso-button-wrapper">
|
|
56341
|
-
<form method="POST" action="/auth/sso" id="sso-direct-form" style="display:none">
|
|
56342
|
-
<input type="hidden" name="state" value="${escapeHtml(state)}" />
|
|
56343
|
-
<input type="hidden" name="email" id="sso-email-hidden" />
|
|
56344
|
-
</form>
|
|
56345
|
-
<button type="button" class="btn btn-default" id="sso-toggle-btn">
|
|
56346
|
-
<svg class="key-icon" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
56347
|
-
<path d="M10 1a5 5 0 0 0-4.546 7.066l-4.161 4.16a.5.5 0 0 0-.146.354V14.5a.5.5 0 0 0 .5.5h2a.5.5 0 0 0 .5-.5V14h1a.5.5 0 0 0 .5-.5v-1h1a.5.5 0 0 0 .354-.146l.94-.94A5 5 0 1 0 10 1zm1.5 4a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z" fill="currentColor"/>
|
|
56348
|
-
</svg>
|
|
56349
|
-
Continue with SSO
|
|
56350
|
-
</button>
|
|
56351
|
-
</div>
|
|
56352
|
-
|
|
56353
|
-
<!-- OR divider -->
|
|
56354
|
-
<div class="line-or">
|
|
56355
|
-
<hr />
|
|
56356
|
-
OR
|
|
56357
|
-
<hr />
|
|
56358
|
-
</div>
|
|
56359
|
-
|
|
56360
|
-
<!-- Email + Password form -->
|
|
56361
|
-
<div class="tab-content active" id="tab-email">
|
|
56362
|
-
<form method="POST" action="/auth/login">
|
|
56363
|
-
<input type="hidden" name="state" value="${escapeHtml(state)}" />
|
|
56364
|
-
<div class="field">
|
|
56365
|
-
<label for="email">Sign in with email:</label>
|
|
56366
|
-
<input type="email" id="email" name="email" required autocomplete="email" />
|
|
56367
|
-
</div>
|
|
56368
|
-
<div class="field">
|
|
56369
|
-
<label for="password">Your password:</label>
|
|
56370
|
-
<input type="password" id="password" name="password" required autocomplete="current-password" />
|
|
56371
|
-
</div>
|
|
56372
|
-
<button type="submit" class="btn btn-primary">Continue</button>
|
|
56373
|
-
</form>
|
|
56374
|
-
</div>
|
|
56375
|
-
|
|
56376
|
-
<!-- SSO form (shown when "Continue with SSO" is clicked) -->
|
|
56377
|
-
<div class="tab-content" id="tab-sso">
|
|
56378
|
-
<form method="POST" action="/auth/sso">
|
|
56379
|
-
<input type="hidden" name="state" value="${escapeHtml(state)}" />
|
|
56380
|
-
<div class="field">
|
|
56381
|
-
<label for="sso-email">Work email:</label>
|
|
56382
|
-
<input type="email" id="sso-email" name="email" required autocomplete="email" />
|
|
56383
|
-
</div>
|
|
56384
|
-
<button type="submit" class="btn btn-primary">Continue with SSO</button>
|
|
56385
|
-
</form>
|
|
56386
|
-
<div class="tab-switch">
|
|
56387
|
-
<a id="back-to-email">Sign in with email instead</a>
|
|
56388
|
-
</div>
|
|
56389
|
-
</div>
|
|
56390
|
-
|
|
56391
|
-
<div style="flex:1"></div>
|
|
56392
|
-
|
|
56393
|
-
<script>
|
|
56394
|
-
var ssoBtn = document.getElementById('sso-toggle-btn');
|
|
56395
|
-
var tabEmail = document.getElementById('tab-email');
|
|
56396
|
-
var tabSso = document.getElementById('tab-sso');
|
|
56397
|
-
var ssoWrapper = document.getElementById('sso-button-wrapper');
|
|
56398
|
-
var lineOr = document.querySelector('.line-or');
|
|
56399
|
-
var backLink = document.getElementById('back-to-email');
|
|
56400
|
-
|
|
56401
|
-
ssoBtn.addEventListener('click', function() {
|
|
56402
|
-
tabEmail.classList.remove('active');
|
|
56403
|
-
tabSso.classList.add('active');
|
|
56404
|
-
ssoWrapper.style.display = 'none';
|
|
56405
|
-
lineOr.style.display = 'none';
|
|
56406
|
-
document.getElementById('sso-email').focus();
|
|
56407
|
-
});
|
|
56408
|
-
|
|
56409
|
-
backLink.addEventListener('click', function() {
|
|
56410
|
-
tabSso.classList.remove('active');
|
|
56411
|
-
tabEmail.classList.add('active');
|
|
56412
|
-
ssoWrapper.style.display = '';
|
|
56413
|
-
lineOr.style.display = '';
|
|
56414
|
-
});
|
|
56415
|
-
</script>
|
|
56416
|
-
</div>
|
|
56417
|
-
</body>
|
|
56418
|
-
</html>`;
|
|
56419
|
-
}
|
|
56420
|
-
function escapeHtml(str) {
|
|
56421
|
-
return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
56422
|
-
}
|
|
56423
|
-
var TEAM_SELECTION_TTL, ACCESS_TOKEN_TTL;
|
|
55789
|
+
var ACCESS_TOKEN_TTL;
|
|
56424
55790
|
var init_auth2 = __esm(() => {
|
|
56425
55791
|
init_errors4();
|
|
56426
|
-
TEAM_SELECTION_TTL = 10 * 60 * 1000;
|
|
56427
55792
|
ACCESS_TOKEN_TTL = 7 * 24 * 3600;
|
|
56428
55793
|
});
|
|
56429
55794
|
|
|
@@ -56528,7 +55893,6 @@ var exports_http = {};
|
|
|
56528
55893
|
__export(exports_http, {
|
|
56529
55894
|
startHttpServer: () => startHttpServer
|
|
56530
55895
|
});
|
|
56531
|
-
import express8 from "express";
|
|
56532
55896
|
function jwtClaims2(jwt2) {
|
|
56533
55897
|
try {
|
|
56534
55898
|
return JSON.parse(Buffer.from(jwt2.split(".")[1], "base64url").toString());
|
|
@@ -56585,18 +55949,6 @@ async function startHttpServer(options) {
|
|
|
56585
55949
|
app.get("/auth/callback", (req, res) => {
|
|
56586
55950
|
provider.handleAuthCallback(req, res);
|
|
56587
55951
|
});
|
|
56588
|
-
app.post("/auth/google", express8.urlencoded({ extended: false }), (req, res) => {
|
|
56589
|
-
provider.handleGoogleLogin(req, res);
|
|
56590
|
-
});
|
|
56591
|
-
app.post("/auth/login", express8.urlencoded({ extended: false }), (req, res) => {
|
|
56592
|
-
provider.handleEmailPasswordLogin(req, res);
|
|
56593
|
-
});
|
|
56594
|
-
app.post("/auth/sso", express8.urlencoded({ extended: false }), (req, res) => {
|
|
56595
|
-
provider.handleSSOLogin(req, res);
|
|
56596
|
-
});
|
|
56597
|
-
app.post("/team-select", express8.urlencoded({ extended: false }), (req, res) => {
|
|
56598
|
-
provider.handleTeamSelection(req, res);
|
|
56599
|
-
});
|
|
56600
55952
|
app.get("/health", (_req, res) => {
|
|
56601
55953
|
res.json({
|
|
56602
55954
|
status: "ok",
|