migrate /auth/sso pages (#18951)

This commit is contained in:
Benny Joo authored and GitHub committed 2025-01-28 21:49:06 +00:00
1 parent 9cec970943
commit 8205431640
7 files changed
+41 -61

No files matched your search

@@ -0,0 +1,20 @@
import { withAppDirSsr } from "app/WithAppDirSsr";
import type { PageProps } from "app/_types";
import { cookies, headers } from "next/headers";
import { buildLegacyCtx } from "@lib/buildLegacyCtx";
import { getServerSideProps } from "@server/lib/auth/sso/[provider]/getServerSideProps";
import type { SSOProviderPageProps } from "~/auth/sso/provider-view";
import SSOProviderView from "~/auth/sso/provider-view";
const getData = withAppDirSsr<SSOProviderPageProps>(getServerSideProps);
const ServerPage = async ({ params, searchParams }: PageProps) => {
const context = buildLegacyCtx(headers(), cookies(), params, searchParams);
const props = await getData(context);
return <SSOProviderView {...props} />;
};
export default ServerPage;
@@ -0,0 +1,20 @@
import { withAppDirSsr } from "app/WithAppDirSsr";
import type { PageProps } from "app/_types";
import { cookies, headers } from "next/headers";
import { buildLegacyCtx } from "@lib/buildLegacyCtx";
import { getServerSideProps } from "@server/lib/auth/sso/direct/getServerSideProps";
import type { SSODirectPageProps } from "~/auth/sso/direct-view";
import SSODirectView from "~/auth/sso/direct-view";
const getData = withAppDirSsr<SSODirectPageProps>(getServerSideProps);
const ServerPage = async ({ params, searchParams }: PageProps) => {
const context = buildLegacyCtx(headers(), cookies(), params, searchParams);
const props = await getData(context);
return <SSODirectView {...props} />;
};
export default ServerPage;
@@ -1,13 +0,0 @@
import { withAppDirSsr } from "app/WithAppDirSsr";
import { WithLayout } from "app/layoutHOC";
import { getServerSideProps } from "@server/lib/auth/sso/[provider]/getServerSideProps";
import type { SSOProviderPageProps } from "~/auth/sso/provider-view";
import SSOProviderView from "~/auth/sso/provider-view";
export default WithLayout({
getLayout: null,
Page: SSOProviderView,
getData: withAppDirSsr<SSOProviderPageProps>(getServerSideProps),
})<"P">;
@@ -1,13 +0,0 @@
import { withAppDirSsr } from "app/WithAppDirSsr";
import { WithLayout } from "app/layoutHOC";
import { getServerSideProps } from "@server/lib/auth/sso/direct/getServerSideProps";
import type { SSODirectPageProps } from "~/auth/sso/direct-view";
import SSODirectView from "~/auth/sso/direct-view";
export default WithLayout({
getLayout: null,
Page: SSODirectView,
getData: withAppDirSsr<SSODirectPageProps>(getServerSideProps),
})<"P">;
+1 -11
View File
@@ -155,17 +155,7 @@ export const config = {
"/api/auth/signup",
"/api/trpc/:path*",
"/login",
"/auth/login",
"/auth/logout",
"/auth/error",
"/auth/signin",
"/auth/oauth2/authorize",
"/auth/platform/authorize",
"/auth/verify-email-change",
"/auth/verify-email",
"/auth/verify",
"/auth/saml-idp",
"/auth/setup",
"/auth/:path*",
/**
* Paths required by routingForms.handle
*/
-12
View File
@@ -1,12 +0,0 @@
import PageWrapper from "@components/PageWrapper";
import { getServerSideProps } from "@server/lib/auth/sso/[provider]/getServerSideProps";
import type { SSOProviderPageProps } from "~/auth/sso/provider-view";
import SSOProviderView from "~/auth/sso/provider-view";
const Page = (props: SSOProviderPageProps) => <SSOProviderView {...props} />;
Page.PageWrapper = PageWrapper;
export default Page;
export { getServerSideProps };
-12
View File
@@ -1,12 +0,0 @@
import PageWrapper from "@components/PageWrapper";
import { getServerSideProps } from "@server/lib/auth/sso/direct/getServerSideProps";
import type { SSODirectPageProps } from "~/auth/sso/direct-view";
import SSODirectView from "~/auth/sso/direct-view";
const Page = (props: SSODirectPageProps) => <SSODirectView {...props} />;
Page.PageWrapper = PageWrapper;
export default Page;
export { getServerSideProps };