mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 05:12:20 +00:00
/login route, extend session cookie for authRequestId
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import * as settings from "./v2/settings";
|
||||
import * as session from "./v2/session";
|
||||
import * as user from "./v2/user";
|
||||
import * as oidc from "./v2/oidc";
|
||||
import * as management from "./management";
|
||||
|
||||
import * as login from "./proto/server/zitadel/settings/v2alpha/login_settings";
|
||||
@@ -24,6 +25,13 @@ export {
|
||||
Challenges_Passkey,
|
||||
} from "./proto/server/zitadel/session/v2alpha/challenge";
|
||||
|
||||
export {
|
||||
GetAuthRequestRequest,
|
||||
GetAuthRequestResponse,
|
||||
CreateCallbackRequest,
|
||||
CreateCallbackResponse,
|
||||
} from "./proto/server/zitadel/oidc/v2alpha/oidc_service";
|
||||
|
||||
export {
|
||||
Session,
|
||||
Factors,
|
||||
@@ -96,4 +104,5 @@ export {
|
||||
login,
|
||||
password,
|
||||
legal,
|
||||
oidc,
|
||||
};
|
||||
|
||||
2
packages/zitadel-server/src/v2/oidc/index.ts
Normal file
2
packages/zitadel-server/src/v2/oidc/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from "./oidc";
|
||||
export * from "../../proto/server/zitadel/oidc/v2alpha/oidc_service";
|
||||
24
packages/zitadel-server/src/v2/oidc/oidc.ts
Normal file
24
packages/zitadel-server/src/v2/oidc/oidc.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { CompatServiceDefinition } from "nice-grpc/lib/service-definitions";
|
||||
|
||||
import { ZitadelServer, createClient, getServers } from "../../server";
|
||||
import { OIDCServiceClient, OIDCServiceDefinition } from ".";
|
||||
|
||||
export const getOidc = (server?: string | ZitadelServer) => {
|
||||
let config;
|
||||
if (server && typeof server === "string") {
|
||||
const apps = getServers();
|
||||
config = apps.find((a) => a.name === server)?.config;
|
||||
} else if (server && typeof server === "object") {
|
||||
config = server.config;
|
||||
}
|
||||
|
||||
if (!config) {
|
||||
throw Error("No ZITADEL server found");
|
||||
}
|
||||
|
||||
return createClient<OIDCServiceClient>(
|
||||
OIDCServiceDefinition as CompatServiceDefinition,
|
||||
config.apiUrl,
|
||||
config.token
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user