Skip to content

Commit

Permalink
Remember to upgrade...and then add the next-auth issue
Browse files Browse the repository at this point in the history
  • Loading branch information
lukevers committed May 11, 2023
1 parent a0ae962 commit 421be2d
Show file tree
Hide file tree
Showing 10 changed files with 380 additions and 63 deletions.
88 changes: 44 additions & 44 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"@types/node": "20.1.2",
"@types/react": "18.2.6",
"@types/react-dom": "18.2.4",
"next": "13.4.1",
"next": "13.4.2-canary.5",
"next-auth": "^4.22.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"typescript": "5.0.4"
Expand Down
2 changes: 1 addition & 1 deletion src/app/issue1/ClientExampleEmbeddedServer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ interface Props {

export default function ClientExampleEmbeddedServer(props: Props) {
return (
<button onClick={async () => alert(await props.action('hi'))}>client passed with own server action as prop: I will alert</button>
<button onClick={async () => console.log('ClientExampleEmbeddedServer', await props.action('hi'))}>client passed with own server action as prop: I will log</button>
)
}
4 changes: 2 additions & 2 deletions src/app/issue1/ClientImportsOwnServer.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use client';

import ServerExample from "./ServerExample2";
import ServerExample2 from "./ServerExample2";

export default function ClientImportsOwnServer() {
return (
<button onClick={async () => alert(await ServerExample('hi'))}>client importing own server action: I will break</button>
<button onClick={async () => console.log('ClientImportsOwnServer', await ServerExample2('hi'))}>client importing own server action: I will break</button>
)
}
6 changes: 2 additions & 4 deletions src/app/issue1/ServerExample.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
'use server';

import { cookies } from 'next/headers';
import { getServerSession } from 'next-auth/next';

export default async function ServerExample(message: string) {
cookies().get('anything');

return 'hey';
return await getServerSession({});
}
8 changes: 3 additions & 5 deletions src/app/issue1/ServerExample2.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
'use server';

import { cookies } from 'next/headers';
import { getServerSession } from 'next-auth/next';

export default async function ServerExample(message: string) {
cookies().get('anything');

return 'hey';
export default async function ServerExample2(message: string) {
return await getServerSession({});
}
2 changes: 1 addition & 1 deletion src/app/issue2/ClientExampleEmbeddedServer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ interface Props {

export default function ClientExampleEmbeddedServer(props: Props) {
return (
<button onClick={async () => alert(await props.action('hi'))}>client passed with shared server action: I will break</button>
<button onClick={async () => console.log('ClientExampleEmbeddedServer', await props.action('hi'))}>client passed with shared server action: I will break</button>
)
}
2 changes: 1 addition & 1 deletion src/app/issue2/ClientImportsOwnServer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import ServerExample from "./SharedServerExample";

export default function ClientImportsOwnServer() {
return (
<button onClick={async () => alert(await ServerExample('hi'))}>client importing shared server action: I will break</button>
<button onClick={async () => console.log('ClientImportsOwnServer', await ServerExample('hi'))}>client importing shared server action: I will break</button>
)
}
6 changes: 2 additions & 4 deletions src/app/issue2/SharedServerExample.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
'use server';

import { cookies } from 'next/headers';
import { getServerSession } from 'next-auth/next';

export default async function ServerExample(message: string) {
cookies().get('anything');

return 'hey';
return await getServerSession({});
}
Loading

0 comments on commit 421be2d

Please sign in to comment.