Something went wrong while processing the OAuth callback:
diff --git a/packages/stack/src/components-page/sign-in.tsx b/packages/stack/src/components-page/sign-in.tsx
index 58695f29c..6e32aa6a9 100644
--- a/packages/stack/src/components-page/sign-in.tsx
+++ b/packages/stack/src/components-page/sign-in.tsx
@@ -1,4 +1,3 @@
-'use client';
import AuthPage from './auth-page';
export default function SignIn({ fullPage=false }: { fullPage?: boolean }) {
diff --git a/packages/stack/src/components-page/sign-out.tsx b/packages/stack/src/components-page/sign-out.tsx
index 8387d048f..ebcfe3117 100644
--- a/packages/stack/src/components-page/sign-out.tsx
+++ b/packages/stack/src/components-page/sign-out.tsx
@@ -4,12 +4,12 @@ import { use } from "react";
import { useUser } from "..";
import GoHomeMessageCard from "../components/redirect-message-card";
-export default function Signout() {
+export default function SignOut(props: { fullPage?: boolean }) {
const user = useUser();
if (user) {
use(user.signOut());
}
- return
;
-}
\ No newline at end of file
+ return
;
+}
diff --git a/packages/stack/src/components-page/stack-handler.tsx b/packages/stack/src/components-page/stack-handler.tsx
index e147def02..98d94d98c 100644
--- a/packages/stack/src/components-page/stack-handler.tsx
+++ b/packages/stack/src/components-page/stack-handler.tsx
@@ -15,14 +15,22 @@ export default async function StackHandler
({
app,
params: { stack } = {},
searchParams = {},
+ // TODO set default to false like on the other components (may break old code)
+ fullPage = "deprecated-unset",
}: {
app: StackServerApp,
params?: { stack?: string[] },
searchParams?: Record,
+ fullPage?: boolean | "deprecated-unset",
}) {
+ if (fullPage === "deprecated-unset") {
+ console.warn("You are not passing `fullPage` to Stack's Handler. The default behaviour will soon change from `true` to `false`. Please update your Handler component in handler/[...stack]/page.tsx by adding the `fullPage` prop.");
+ fullPage = true;
+ }
+
if (!stack) {
return (
-
+
Can't use Stack handler at this location. Make sure that the file is in a folder called [...stack].
);
@@ -52,40 +60,40 @@ export default async function StackHandler({
case 'signin': {
redirectIfNotHandler('signIn');
await redirectIfHasUser();
- return ;
+ return ;
}
case 'signup': {
redirectIfNotHandler('signUp');
await redirectIfHasUser();
- return ;
+ return ;
}
case 'email-verification': {
redirectIfNotHandler('emailVerification');
- return ;
+ return ;
}
case 'password-reset': {
redirectIfNotHandler('passwordReset');
- return ;
+ return ;
}
case 'forgot-password': {
redirectIfNotHandler('forgotPassword');
- return ;
+ return ;
}
case 'signout': {
redirectIfNotHandler('signOut');
- return ;
+ return ;
}
case 'oauth-callback': {
redirectIfNotHandler('oauthCallback');
- return ;
+ return ;
}
case 'account-settings': {
redirectIfNotHandler('accountSettings');
- return ;
+ return ;
}
case 'magic-link-callback': {
redirectIfNotHandler('magicLinkCallback');
- return ;
+ return ;
}
default: {
return notFound();
diff --git a/packages/stack/src/components/card-frame.tsx b/packages/stack/src/components/card-frame.tsx
deleted file mode 100644
index 1ddef5d22..000000000
--- a/packages/stack/src/components/card-frame.tsx
+++ /dev/null
@@ -1,43 +0,0 @@
-'use client';
-
-import { Container } from "../components-core";
-import React, { useEffect, useState } from "react";
-
-export default function CardFrame({
- children,
- fullPage=true
-}: {
- children: React.ReactNode,
- fullPage?: boolean,
-}) {
- const [hasNoParent, setHasNoParent] = useState(false);
- useEffect(() => {
- const component = document.getElementById('stack-card-frame');
- setHasNoParent(
- !component?.parentElement ||
- component?.parentElement === document.body ||
- component?.parentElement === document.documentElement
- );
- }, []);
-
- if (fullPage) {
- return (
-
-
- {children}
-
-
- );
- } else {
- return children;
- }
-
-}
diff --git a/packages/stack/src/components/maybe-full-page.tsx b/packages/stack/src/components/maybe-full-page.tsx
new file mode 100644
index 000000000..c01343f82
--- /dev/null
+++ b/packages/stack/src/components/maybe-full-page.tsx
@@ -0,0 +1,57 @@
+"use client";
+
+import { Container } from "../components-core";
+import React, { useEffect, useId } from "react";
+
+export default function MaybeFullPage({
+ children,
+ fullPage=true
+}: {
+ children: React.ReactNode,
+ fullPage?: boolean,
+}) {
+ const uniqueId = useId();
+ const id = `stack-card-frame-${uniqueId}`;
+
+ const scriptString = `(([id]) => {
+ const el = document.getElementById(id);
+ const offset = el.getBoundingClientRect().top + document.documentElement.scrollTop;
+ el.style.minHeight = \`calc(100vh - \${offset}px)\`;
+ })(${JSON.stringify([id])})`;
+
+ useEffect(() => {
+ // React has a bug where it doesn't run the script on the first CSR render if SSR has been skipped due to suspense
+ // As a workaround, we run the script in the