Skip to content

Commit 3b263ac

Browse files
committed
make ux a little bit better on initial signup
1 parent 2081669 commit 3b263ac

File tree

3 files changed

+43
-5
lines changed

3 files changed

+43
-5
lines changed

apps/nextjs/src/app/page.tsx

+16-4
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,30 @@
1+
"use client";
2+
13
import { Metadata } from "next";
24
import Image from "next/image";
35
import Link from "next/link";
6+
import { redirect, useSearchParams } from "next/navigation";
47
import { buttonVariants } from "@/components/ui/button";
58
import { SignUp } from "@/components/user-auth-form";
69
import { cn } from "@/lib/utils";
710

811
import { signup } from "./actions";
912

10-
export const metadata: Metadata = {
11-
title: "Authentication",
12-
description: "Authentication forms built using the components.",
13-
};
13+
// export const metadata: Metadata = {
14+
// title: "Authentication",
15+
// description: "Authentication forms built using the components.",
16+
// };
1417

1518
export default function AuthenticationPage() {
19+
const searchParams = useSearchParams();
20+
const noredir = searchParams.get("noredir");
21+
const code = searchParams.get("code");
22+
if (code) {
23+
redirect("/signin?signup=true&code=" + code);
24+
}
25+
// if (!noredir) {
26+
// redirect("/signin");
27+
// }
1628
return (
1729
<>
1830
<div className="md:hidden">
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import React from "react";
2+
3+
import { Alert, AlertDescription, AlertTitle } from "../../components/ui/alert";
4+
5+
const SuccessPage: React.FC = () => {
6+
return (
7+
<div>
8+
<Alert>
9+
<AlertTitle>Success!</AlertTitle>
10+
<AlertDescription>
11+
Your account on "scouting-app" has been created successfully.
12+
</AlertDescription>
13+
</Alert>
14+
</div>
15+
);
16+
};
17+
18+
export default SuccessPage;

apps/nextjs/src/app/signin/page.tsx

+9-1
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,21 @@
33
import { Metadata } from "next";
44
import Image from "next/image";
55
import Link from "next/link";
6+
import { redirect, useSearchParams } from "next/navigation";
67
import { buttonVariants } from "@/components/ui/button";
78
import { SignIn } from "@/components/user-auth-form";
89
import { cn } from "@/lib/utils";
910

1011
import { signin } from "./actions";
1112

1213
export default function LoginPage() {
14+
const searchParams = useSearchParams();
15+
const noredir = searchParams.get("noredir");
16+
const code = searchParams.get("code");
17+
const isSignup = searchParams.get("signup");
18+
if (code && isSignup) {
19+
redirect("/registered?action=show_coming_soon&code=" + code);
20+
}
1321
return (
1422
<>
1523
<div className="md:hidden">
@@ -30,7 +38,7 @@ export default function LoginPage() {
3038
</div>
3139
<div className="container relative hidden h-screen flex-col items-center justify-center md:grid lg:max-w-none lg:grid-cols-2 lg:px-0">
3240
<Link
33-
href="/signup"
41+
href="/?noredir=true"
3442
className={cn(
3543
buttonVariants({ variant: "ghost" }),
3644
"absolute right-4 top-4 md:right-8 md:top-8",

0 commit comments

Comments
 (0)