Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b9679cb

Browse files
Merge pull request #26 from vercel/fix-signin-redirect
2 parents d378b19 + 686e23a commit b9679cb

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

‎app/login/page.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export default function Login() {
1010
<Link href="/">
1111
<Image
1212
src="/logo.png"
13+
priority
1314
alt="Logo"
1415
className="h-10 w-10 rounded-full"
1516
width={20}

‎app/register/page.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export default function Login() {
1010
<Link href="/">
1111
<Image
1212
src="/logo.png"
13+
priority
1314
alt="Logo"
1415
className="h-10 w-10 rounded-full"
1516
width={20}

‎components/form.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,12 @@ export default function Form({ type }: { type: "login" | "register" }) {
1818
setLoading(true);
1919
if (type === "login") {
2020
signIn("credentials", {
21-
redirect: false,
21+
callbackUrl: "/protected",
2222
email: e.currentTarget.email.value,
2323
password: e.currentTarget.password.value,
2424
// @ts-ignore
25-
}).then(({ ok, error }) => {
26-
console.log("ok", ok, "error", error);
25+
}).then(({ error }) => {
2726
setLoading(false);
28-
if (ok) {
29-
router.push("/protected");
30-
}
3127
if (error) {
3228
toast.error(error);
3329
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /