Skip to content

Commit

Permalink
fix(dev): fix import links for authOptions (#8938)
Browse files Browse the repository at this point in the history
* fixed instruction link

* fixed import link of authOptions in dev app

* deleted old, obsolete authOptions

---------

Co-authored-by: Thang Vu <hi@thvu.dev>
  • Loading branch information
goerlitz and ThangHuuVu authored Nov 4, 2023
1 parent 09f5aab commit 18e8b92
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 139 deletions.
2 changes: 1 addition & 1 deletion apps/dev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
This folder contains a Next.js app using NextAuth.js for local development. See the following section on how to start:

[Setting up local environment
](https://github.com/nextauthjs/next-auth/blob/main/CONTRIBUTING.md#setting-up-local-environment)
](https://github.com/nextauthjs/.github/blob/main/CONTRIBUTING.md#setting-up-local-environment)
132 changes: 0 additions & 132 deletions apps/dev/pages/api/auth-old/[...nextauth].ts

This file was deleted.

2 changes: 1 addition & 1 deletion apps/dev/pages/api/examples/protected.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This is an example of to protect an API route
import { getServerSession } from "next-auth/next"
import { authOptions } from "../auth/[...nextauth]"
import { authOptions } from "/app/api/auth/[...nextauth]/route"

export default async (req, res) => {
const session = await getServerSession(req, res, authOptions)
Expand Down
2 changes: 1 addition & 1 deletion apps/dev/pages/api/examples/session.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This is an example of how to access a session from an API route
import { getServerSession } from "next-auth/next"
import { authOptions } from "../auth/[...nextauth]"
import { authOptions } from "/app/api/auth/[...nextauth]/route"

export default async (req, res) => {
const session = await getServerSession(req, res, authOptions)
Expand Down
2 changes: 1 addition & 1 deletion apps/dev/pages/api/examples/supabase-rls.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This is an example of how to query data from Supabase with RLS.
// Learn more about Row Levele Security (RLS): https://supabase.com/docs/guides/auth/row-level-security
import { getServerSession } from "next-auth/next"
import { authOptions } from "../auth/[...nextauth]"
import { authOptions } from "/app/api/auth/[...nextauth]/route"
import { createClient } from "@supabase/supabase-js"

export default async (req, res) => {
Expand Down
2 changes: 1 addition & 1 deletion apps/dev/pages/protected-ssr.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This is an example of how to protect content using server rendering
import { getServerSession } from "next-auth/next"
import { authOptions } from "./api/auth/[...nextauth]"
import { authOptions } from "/app/api/auth/[...nextauth]/route"
import Layout from "../components/layout"
import AccessDenied from "../components/access-denied"

Expand Down
2 changes: 1 addition & 1 deletion apps/dev/pages/server.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getServerSession } from "next-auth/next"
import Layout from "../components/layout"
import { authOptions } from "./api/auth/[...nextauth]"
import { authOptions } from "/app/api/auth/[...nextauth]/route"

export default function Page() {
// As this page uses Server Side Rendering, the `session` will be already
Expand Down
2 changes: 1 addition & 1 deletion apps/dev/pages/supabase-ssr.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This is an example of how to protect content using server rendering
// and fetching data from Supabase with RLS enabled.
import { getServerSession } from "next-auth/next"
import { authOptions } from "./api/auth/[...nextauth]"
import { authOptions } from "/app/api/auth/[...nextauth]/route"
import { createClient } from "@supabase/supabase-js"
import Layout from "../components/layout"
import AccessDenied from "../components/access-denied"
Expand Down

1 comment on commit 18e8b92

@vercel
Copy link

@vercel vercel bot commented on 18e8b92 Nov 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.