mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 17:57:33 +00:00
fmt
This commit is contained in:
@@ -1,14 +1,16 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import { createServerTransport } from "./zitadel";
|
|
||||||
import { createUserServiceClient } from "@zitadel/client/v2";
|
import { createUserServiceClient } from "@zitadel/client/v2";
|
||||||
import { headers } from "next/headers";
|
import { headers } from "next/headers";
|
||||||
import { getSessionCookieById } from "./cookies";
|
import { getSessionCookieById } from "./cookies";
|
||||||
import { getServiceUrlFromHeaders } from "./service-url";
|
import { getServiceUrlFromHeaders } from "./service-url";
|
||||||
import { getSession } from "./zitadel";
|
import { createServerTransport, getSession } from "./zitadel";
|
||||||
|
|
||||||
const myUserService = async (serviceUrl: string, sessionToken: string) => {
|
const myUserService = async (serviceUrl: string, sessionToken: string) => {
|
||||||
const transportPromise = await createServerTransport(sessionToken, serviceUrl);
|
const transportPromise = await createServerTransport(
|
||||||
|
sessionToken,
|
||||||
|
serviceUrl,
|
||||||
|
);
|
||||||
return createUserServiceClient(transportPromise);
|
return createUserServiceClient(transportPromise);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -17,7 +17,6 @@ import {
|
|||||||
setUserPassword,
|
setUserPassword,
|
||||||
} from "@/lib/zitadel";
|
} from "@/lib/zitadel";
|
||||||
import { ConnectError, create } from "@zitadel/client";
|
import { ConnectError, create } from "@zitadel/client";
|
||||||
import { createServerTransport } from "../zitadel";
|
|
||||||
import { createUserServiceClient } from "@zitadel/client/v2";
|
import { createUserServiceClient } from "@zitadel/client/v2";
|
||||||
import {
|
import {
|
||||||
Checks,
|
Checks,
|
||||||
@@ -39,6 +38,7 @@ import {
|
|||||||
checkPasswordChangeRequired,
|
checkPasswordChangeRequired,
|
||||||
checkUserVerification,
|
checkUserVerification,
|
||||||
} from "../verify-helper";
|
} from "../verify-helper";
|
||||||
|
import { createServerTransport } from "../zitadel";
|
||||||
|
|
||||||
type ResetPasswordCommand = {
|
type ResetPasswordCommand = {
|
||||||
loginName: string;
|
loginName: string;
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
import { createClientFor } from "@zitadel/client";
|
import { createClientFor } from "@zitadel/client";
|
||||||
import { createServerTransport } from "./zitadel";
|
|
||||||
import { IdentityProviderService } from "@zitadel/proto/zitadel/idp/v2/idp_service_pb";
|
import { IdentityProviderService } from "@zitadel/proto/zitadel/idp/v2/idp_service_pb";
|
||||||
import { OIDCService } from "@zitadel/proto/zitadel/oidc/v2/oidc_service_pb";
|
import { OIDCService } from "@zitadel/proto/zitadel/oidc/v2/oidc_service_pb";
|
||||||
import { OrganizationService } from "@zitadel/proto/zitadel/org/v2/org_service_pb";
|
import { OrganizationService } from "@zitadel/proto/zitadel/org/v2/org_service_pb";
|
||||||
@@ -8,6 +7,7 @@ import { SessionService } from "@zitadel/proto/zitadel/session/v2/session_servic
|
|||||||
import { SettingsService } from "@zitadel/proto/zitadel/settings/v2/settings_service_pb";
|
import { SettingsService } from "@zitadel/proto/zitadel/settings/v2/settings_service_pb";
|
||||||
import { UserService } from "@zitadel/proto/zitadel/user/v2/user_service_pb";
|
import { UserService } from "@zitadel/proto/zitadel/user/v2/user_service_pb";
|
||||||
import { systemAPIToken } from "./api";
|
import { systemAPIToken } from "./api";
|
||||||
|
import { createServerTransport } from "./zitadel";
|
||||||
|
|
||||||
type ServiceClass =
|
type ServiceClass =
|
||||||
| typeof IdentityProviderService
|
| typeof IdentityProviderService
|
||||||
|
@@ -1,4 +1,6 @@
|
|||||||
|
import { Transport } from "@connectrpc/connect";
|
||||||
import { Client, create, Duration } from "@zitadel/client";
|
import { Client, create, Duration } from "@zitadel/client";
|
||||||
|
import { createServerTransport as libCreateServerTransport } from "@zitadel/client/node";
|
||||||
import { makeReqCtx } from "@zitadel/client/v2";
|
import { makeReqCtx } from "@zitadel/client/v2";
|
||||||
import { IdentityProviderService } from "@zitadel/proto/zitadel/idp/v2/idp_service_pb";
|
import { IdentityProviderService } from "@zitadel/proto/zitadel/idp/v2/idp_service_pb";
|
||||||
import {
|
import {
|
||||||
@@ -52,8 +54,6 @@ import {
|
|||||||
import { unstable_cacheLife as cacheLife } from "next/cache";
|
import { unstable_cacheLife as cacheLife } from "next/cache";
|
||||||
import { getUserAgent } from "./fingerprint";
|
import { getUserAgent } from "./fingerprint";
|
||||||
import { createServiceForHost } from "./service";
|
import { createServiceForHost } from "./service";
|
||||||
import { createServerTransport as libCreateServerTransport } from "@zitadel/client/node";
|
|
||||||
import { Transport } from '@connectrpc/connect';
|
|
||||||
|
|
||||||
const useCache = process.env.DEBUG !== "true";
|
const useCache = process.env.DEBUG !== "true";
|
||||||
|
|
||||||
@@ -1500,20 +1500,23 @@ export async function listAuthenticationMethodTypes({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createServerTransport(token: string, baseUrl: string): Transport {
|
export function createServerTransport(
|
||||||
|
token: string,
|
||||||
|
baseUrl: string,
|
||||||
|
): Transport {
|
||||||
return libCreateServerTransport(token, {
|
return libCreateServerTransport(token, {
|
||||||
baseUrl,
|
baseUrl,
|
||||||
interceptors: !process.env.CUSTOM_REQUEST_HEADERS
|
interceptors: !process.env.CUSTOM_REQUEST_HEADERS
|
||||||
? undefined
|
? undefined
|
||||||
: [
|
: [
|
||||||
(next) => {
|
(next) => {
|
||||||
return (req) => {
|
return (req) => {
|
||||||
process.env.CUSTOM_REQUEST_HEADERS!.split(",").forEach(
|
process.env
|
||||||
(header) => {
|
.CUSTOM_REQUEST_HEADERS!.split(",")
|
||||||
const kv = header.split(":");
|
.forEach((header) => {
|
||||||
req.header.set(kv[0], kv[1]);
|
const kv = header.split(":");
|
||||||
},
|
req.header.set(kv[0], kv[1]);
|
||||||
);
|
});
|
||||||
return next(req);
|
return next(req);
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user