Skip to content

Commit

Permalink
Merge branch 'canary' into abhinay
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinaypandey02 authored Feb 19, 2024
2 parents 2350adf + d8865d0 commit 2c8f1b0
Show file tree
Hide file tree
Showing 42 changed files with 328 additions and 221 deletions.
68 changes: 34 additions & 34 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ swc_core = { version = "0.90.8", features = [
testing = { version = "0.35.18" }

# Turbo crates
turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240216.2" }
turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240219.1" }
# [TODO]: need to refactor embed_directory! macro usages, as well as resolving turbo_tasks::function, macros..
turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240216.2" }
turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240219.1" }
# [TODO]: need to refactor embed_directory! macro usage in next-core
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240216.2" }
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240219.1" }

# General Deps

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Create your first page and shared layout with the App Router.

> We recommend reading the [Routing Fundamentals](/docs/app/building-your-application/routing) and [Defining Routes](/docs/app/building-your-application/routing/defining-routes) pages before continuing.
The special files [layout.js](#layouts), [pages.js](#pages), and [template.js](#templates) allow you to create UI for a [route](/docs/app/building-your-application/routing/defining-routes#creating-routes). This page will guide you through how and when to use these special files.
The special files [layout.js](#layouts), [page.js](#pages), and [template.js](#templates) allow you to create UI for a [route](/docs/app/building-your-application/routing/defining-routes#creating-routes). This page will guide you through how and when to use these special files.

## Pages

Expand Down
5 changes: 3 additions & 2 deletions examples/with-supabase/app/auth/callback/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ export async function GET(request: Request) {
// https://supabase.com/docs/guides/auth/server-side/nextjs
const requestUrl = new URL(request.url);
const code = requestUrl.searchParams.get("code");
const origin = requestUrl.origin;

if (code) {
const supabase = createClient();
await supabase.auth.exchangeCodeForSession(code);
}

// URL to redirect to after sign in process completes
return NextResponse.redirect(requestUrl.origin);
// URL to redirect to after sign up process completes
return NextResponse.redirect(`${origin}/protected`);
}
21 changes: 12 additions & 9 deletions examples/with-supabase/app/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Link from "next/link";
import { headers } from "next/headers";
import { createClient } from "@/utils/supabase/server";
import { redirect } from "next/navigation";
import { SubmitButton } from "./submit-button";

export default function Login({
searchParams,
Expand All @@ -24,7 +25,7 @@ export default function Login({
return redirect("/login?message=Could not authenticate user");
}

return redirect("/");
return redirect("/protected");
};

const signUp = async (formData: FormData) => {
Expand Down Expand Up @@ -73,10 +74,7 @@ export default function Login({
Back
</Link>

<form
className="animate-in flex-1 flex flex-col w-full justify-center gap-2 text-foreground"
action={signIn}
>
<form className="animate-in flex-1 flex flex-col w-full justify-center gap-2 text-foreground">
<label className="text-md" htmlFor="email">
Email
</label>
Expand All @@ -96,15 +94,20 @@ export default function Login({
placeholder="••••••••"
required
/>
<button className="bg-green-700 rounded-md px-4 py-2 text-foreground mb-2">
<SubmitButton
formAction={signIn}
className="bg-green-700 rounded-md px-4 py-2 text-foreground mb-2"
pendingText="Signing In..."
>
Sign In
</button>
<button
</SubmitButton>
<SubmitButton
formAction={signUp}
className="border border-foreground/20 rounded-md px-4 py-2 text-foreground mb-2"
pendingText="Signing Up..."
>
Sign Up
</button>
</SubmitButton>
{searchParams?.message && (
<p className="mt-4 p-4 bg-foreground/10 text-foreground text-center">
{searchParams.message}
Expand Down
Loading

0 comments on commit 2c8f1b0

Please sign in to comment.