-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into will/un-71-frontpage-moderation
- Loading branch information
Showing
49 changed files
with
2,188 additions
and
517 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
module.exports = { | ||
root: true, | ||
extends: ["@repo/eslint-config/next.js"], | ||
rules: { | ||
"no-restricted-imports": ["error", "next/link"], | ||
}, | ||
}; |
2 changes: 1 addition & 1 deletion
2
packages/atproto-browser/app/at/[identifier]/[collection]/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
"use client"; | ||
// eslint-disable-next-line no-restricted-imports | ||
import NextLink from "next/link"; | ||
import { useRouter } from "next/navigation"; | ||
import { ComponentProps } from "react"; | ||
|
||
export default function Link(props: ComponentProps<typeof NextLink>) { | ||
const router = useRouter(); | ||
function prefetch() { | ||
router.prefetch(props.href.toString()); | ||
} | ||
|
||
return ( | ||
<NextLink | ||
{...props} | ||
prefetch={false} | ||
onMouseEnter={props.prefetch ? prefetch : undefined} | ||
onTouchStart={props.prefetch ? prefetch : undefined} | ||
/> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
AUTH_SECRET="op://Unravel Dev/Frontpage Dev Env/DRAINPIPE_CONSUMER_SECRET" | ||
# DISCORD_WEBHOOK_URL="op://Unravel Dev/Frontpage Dev Env/DISCORD_WEBHOOK_URL" | ||
DRAINPIPE_CONSUMER_SECRET="op://Unravel Dev/Frontpage Dev Env/DRAINPIPE_CONSUMER_SECRET" | ||
PRIVATE_JWK="op://Unravel Dev/Frontpage Dev Env/PRIVATE_JWK" | ||
PUBLIC_JWK="op://Unravel Dev/Frontpage Dev Env/PUBLIC_JWK" | ||
|
||
TURSO_CONNECTION_URL="op://Unravel Dev/Frontpage Dev Env/TURSO_CONNECTION_URL" | ||
TURSO_AUTH_TOKEN="op://Unravel Dev/Frontpage Dev Env/TURSO_AUTH_TOKEN" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,23 @@ | ||
# frontpage | ||
|
||
Frontpage AppView and frontend client. | ||
|
||
## Running locally | ||
|
||
If you just need to work on the app in a logged-out state, then you just need to run the following: | ||
|
||
```bash | ||
pnpm run dev | ||
``` | ||
|
||
If you need to login, you need to setup some additional env vars and serve your dev server over the public internet. You can do this with `cloudflared` altho other options are available eg. `ngrok` or `tailscale`: | ||
|
||
```bash | ||
pnpm exec tsx ./scripts/generate-jwks.mts # Copy this output into .env.local | ||
|
||
# In one terminal, start the dev server | ||
pnpm run dev | ||
|
||
# In another terminal, open the tunnel. This example uses `cloudflared` | ||
cloudflared tunnel --url http://localhost:3000 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...e/app/(app)/post/[postAuthor]/[postRkey]/[commentAuthor]/[commentRkey]/_lib/page-data.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...s/frontpage/app/(app)/post/[postAuthor]/[postRkey]/[commentAuthor]/[commentRkey]/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/frontpage/app/(app)/post/[postAuthor]/[postRkey]/_lib/page-data.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,12 @@ | ||
"use server"; | ||
import { signIn } from "@/lib/auth"; | ||
import { AuthError } from "next-auth"; | ||
import { signIn } from "@/lib/auth-sign-in"; | ||
|
||
export async function loginAction(_prevStart: unknown, formData: FormData) { | ||
try { | ||
formData.set("redirectTo", "/"); | ||
await signIn(formData); | ||
} catch (error) { | ||
if (error instanceof AuthError) { | ||
return { error: "Failed to sign in." }; | ||
} | ||
throw error; | ||
const identifier = formData.get("identifier") as string; | ||
const result = await signIn(identifier.replace(/^@/, "")); | ||
if (result && "error" in result) { | ||
return { | ||
error: `An error occured while signing in (${result.error})`, | ||
}; | ||
} | ||
} |
Oops, something went wrong.