Skip to content

Commit 8205431

Browse files
authored
migrate /auth/sso pages (calcom#18951)
1 parent 9cec970 commit 8205431

File tree

7 files changed

+41
-61
lines changed

7 files changed

+41
-61
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { withAppDirSsr } from "app/WithAppDirSsr";
2+
import type { PageProps } from "app/_types";
3+
import { cookies, headers } from "next/headers";
4+
5+
import { buildLegacyCtx } from "@lib/buildLegacyCtx";
6+
7+
import { getServerSideProps } from "@server/lib/auth/sso/[provider]/getServerSideProps";
8+
9+
import type { SSOProviderPageProps } from "~/auth/sso/provider-view";
10+
import SSOProviderView from "~/auth/sso/provider-view";
11+
12+
const getData = withAppDirSsr<SSOProviderPageProps>(getServerSideProps);
13+
const ServerPage = async ({ params, searchParams }: PageProps) => {
14+
const context = buildLegacyCtx(headers(), cookies(), params, searchParams);
15+
const props = await getData(context);
16+
17+
return <SSOProviderView {...props} />;
18+
};
19+
20+
export default ServerPage;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { withAppDirSsr } from "app/WithAppDirSsr";
2+
import type { PageProps } from "app/_types";
3+
import { cookies, headers } from "next/headers";
4+
5+
import { buildLegacyCtx } from "@lib/buildLegacyCtx";
6+
7+
import { getServerSideProps } from "@server/lib/auth/sso/direct/getServerSideProps";
8+
9+
import type { SSODirectPageProps } from "~/auth/sso/direct-view";
10+
import SSODirectView from "~/auth/sso/direct-view";
11+
12+
const getData = withAppDirSsr<SSODirectPageProps>(getServerSideProps);
13+
const ServerPage = async ({ params, searchParams }: PageProps) => {
14+
const context = buildLegacyCtx(headers(), cookies(), params, searchParams);
15+
const props = await getData(context);
16+
17+
return <SSODirectView {...props} />;
18+
};
19+
20+
export default ServerPage;

apps/web/app/future/auth/sso/[provider]/page.tsx

-13
This file was deleted.

apps/web/app/future/auth/sso/direct/page.tsx

-13
This file was deleted.

apps/web/middleware.ts

+1-11
Original file line numberDiff line numberDiff line change
@@ -155,17 +155,7 @@ export const config = {
155155
"/api/auth/signup",
156156
"/api/trpc/:path*",
157157
"/login",
158-
"/auth/login",
159-
"/auth/logout",
160-
"/auth/error",
161-
"/auth/signin",
162-
"/auth/oauth2/authorize",
163-
"/auth/platform/authorize",
164-
"/auth/verify-email-change",
165-
"/auth/verify-email",
166-
"/auth/verify",
167-
"/auth/saml-idp",
168-
"/auth/setup",
158+
"/auth/:path*",
169159
/**
170160
* Paths required by routingForms.handle
171161
*/

apps/web/pages/auth/sso/[provider].tsx

-12
This file was deleted.

apps/web/pages/auth/sso/direct.tsx

-12
This file was deleted.

0 commit comments

Comments
 (0)