Fix sign-in links and legacy JWT after Periscope rebrand.
/login 404ed from marketing CTAs; redirect to /sign-in and accept pinscope-local tokens plus dual-host CORS so login works on both hostnames. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -44,12 +44,12 @@ export function Nav() {
|
||||
</Link>
|
||||
) : (
|
||||
<>
|
||||
<Link href="/login">
|
||||
<Link href="/sign-in">
|
||||
<Button variant="ghost" size="sm">
|
||||
Sign in
|
||||
</Button>
|
||||
</Link>
|
||||
<Link href="/login">
|
||||
<Link href="/sign-up">
|
||||
<Button
|
||||
size="sm"
|
||||
className="bg-blue-600 hover:bg-blue-500 text-white border-0"
|
||||
|
||||
@@ -22,12 +22,12 @@ export function NavAuthCluster() {
|
||||
}
|
||||
return (
|
||||
<>
|
||||
<Link href="/login">
|
||||
<Link href="/sign-in">
|
||||
<Button variant="ghost" size="sm">
|
||||
Sign in
|
||||
</Button>
|
||||
</Link>
|
||||
<Link href="/login">
|
||||
<Link href="/sign-up">
|
||||
<Button
|
||||
size="sm"
|
||||
className="bg-blue-600 hover:bg-blue-500 text-white border-0"
|
||||
@@ -41,7 +41,7 @@ export function NavAuthCluster() {
|
||||
|
||||
export function PrimaryCta() {
|
||||
const { isSignedIn } = useOptionalAuth();
|
||||
const href = isSignedIn ? "/dashboard" : "/login";
|
||||
const href = isSignedIn ? "/dashboard" : "/sign-up";
|
||||
const label = isSignedIn ? "Go to Dashboard" : "Start for free";
|
||||
return (
|
||||
<Link href={href}>
|
||||
@@ -59,7 +59,7 @@ export function PrimaryCta() {
|
||||
export function PricingCta() {
|
||||
const { isSignedIn } = useOptionalAuth();
|
||||
return (
|
||||
<Link href={isSignedIn ? "/billing" : "/login"}>
|
||||
<Link href={isSignedIn ? "/billing" : "/sign-up"}>
|
||||
<Button
|
||||
size="sm"
|
||||
className="bg-blue-600 hover:bg-blue-500 text-white border-0 gap-1.5"
|
||||
|
||||
@@ -29,7 +29,14 @@ export default function SignInPage() {
|
||||
});
|
||||
const data = await res.json().catch(() => ({}));
|
||||
if (!res.ok) {
|
||||
throw new Error(data.detail || "Sign in failed");
|
||||
const detail = data.detail;
|
||||
const msg =
|
||||
typeof detail === "string"
|
||||
? detail
|
||||
: Array.isArray(detail)
|
||||
? detail.map((d: { msg?: string }) => d.msg || JSON.stringify(d)).join("; ")
|
||||
: "Sign in failed";
|
||||
throw new Error(msg);
|
||||
}
|
||||
storeAuthToken(data.token);
|
||||
router.replace("/");
|
||||
|
||||
@@ -35,9 +35,13 @@ export default function SignUpPage() {
|
||||
const data = await res.json().catch(() => ({}));
|
||||
if (!res.ok) {
|
||||
const detail = data.detail;
|
||||
throw new Error(
|
||||
typeof detail === "string" ? detail : "Could not create account",
|
||||
);
|
||||
const msg =
|
||||
typeof detail === "string"
|
||||
? detail
|
||||
: Array.isArray(detail)
|
||||
? detail.map((d: { msg?: string }) => d.msg || JSON.stringify(d)).join("; ")
|
||||
: "Could not create account";
|
||||
throw new Error(msg);
|
||||
}
|
||||
storeAuthToken(data.token);
|
||||
router.replace("/");
|
||||
|
||||
Reference in New Issue
Block a user