Skip to content

Commit

Permalink
Fix typos in next.js page router username & password tutorial and oth…
Browse files Browse the repository at this point in the history
…er places (#1508)
  • Loading branch information
faishalirwn authored Mar 25, 2024
1 parent 3df0109 commit 9428122
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/pages/guides/email-and-password/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ app.post("/login", async (request: Request) => {
// However, valid emails can be already be revealed with the signup page
// and a similar timing issue can likely be found in password reset implementation.
// It will also be much more resource intensive.
// Since protecting against this is none-trivial,
// Since protecting against this is non-trivial,
// it is crucial your implementation is protected against brute-force attacks with login throttling etc.
// If emails/usernames are public, you may outright tell the user that the username is invalid.
return new Response("Invalid email or password", {
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/tutorials/username-and-password/astro.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export async function POST(context: APIContext): Promise<Response> {
// As a preventive measure, you may want to hash passwords even for invalid usernames.
// However, valid usernames can be already be revealed with the signup page among other methods.
// It will also be much more resource intensive.
// Since protecting against this is none-trivial,
// Since protecting against this is non-trivial,
// it is crucial your implementation is protected against brute-force attacks with login throttling etc.
// If usernames are public, you may outright tell the user that the username is invalid.
return new Response("Incorrect username or password", {
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/tutorials/username-and-password/nextjs-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ async function login(_: any, formData: FormData): Promise<ActionResult> {
// As a preventive measure, you may want to hash passwords even for invalid usernames.
// However, valid usernames can be already be revealed with the signup page among other methods.
// It will also be much more resource intensive.
// Since protecting against this is none-trivial,
// Since protecting against this is non-trivial,
// it is crucial your implementation is protected against brute-force attacks with login throttling etc.
// If usernames are public, you may outright tell the user that the username is invalid.
return {
Expand Down
6 changes: 3 additions & 3 deletions docs/pages/tutorials/username-and-password/nextjs-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ const length = new TextEncoder().encode(password).length;
Create `pages/login.tsx` and set up a basic form.

```tsx
// pages/signup.tsx
// pages/login.tsx
import { useRouter } from "next/router";
import type { FormEvent } from "react";

Expand All @@ -193,7 +193,7 @@ export default function Page() {

return (
<>
<h1>Create an account</h1>
<h1>Sign in</h1>
<form method="post" action="/api/login" onSubmit={onSubmit}>
<label htmlFor="username">Username</label>
<input name="username" id="username" />
Expand Down Expand Up @@ -255,7 +255,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
// As a preventive measure, you may want to hash passwords even for invalid usernames.
// However, valid usernames can be already be revealed with the signup page among other methods.
// It will also be much more resource intensive.
// Since protecting against this is none-trivial,
// Since protecting against this is non-trivial,
// it is crucial your implementation is protected against brute-force attacks with login throttling etc.
// If usernames are public, you may outright tell the user that the username is invalid.
res.status(400).json({
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/tutorials/username-and-password/nuxt.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export default eventHandler(async (event) => {
// As a preventive measure, you may want to hash passwords even for invalid usernames.
// However, valid usernames can be already be revealed with the signup page among other methods.
// It will also be much more resource intensive.
// Since protecting against this is none-trivial,
// Since protecting against this is non-trivial,
// it is crucial your implementation is protected against brute-force attacks with login throttling etc.
// If usernames are public, you may outright tell the user that the username is invalid.
throw createError({
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/tutorials/username-and-password/sveltekit.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export const actions: Actions = {
// As a preventive measure, you may want to hash passwords even for invalid usernames.
// However, valid usernames can be already be revealed with the signup page among other methods.
// It will also be much more resource intensive.
// Since protecting against this is none-trivial,
// Since protecting against this is non-trivial,
// it is crucial your implementation is protected against brute-force attacks with login throttling etc.
// If usernames are public, you may outright tell the user that the username is invalid.
return fail(400, {
Expand Down

0 comments on commit 9428122

Please sign in to comment.