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