From 72626baf9df0df49adc7d527f04c0e7705ce0ad0 Mon Sep 17 00:00:00 2001 From: Shivam Dua Date: Tue, 5 Sep 2023 16:54:51 +0530 Subject: [PATCH] Docs: Fix userId assignment (#1075) --- .../content/guidebook/email-verification-links/index.md | 2 +- .../guidebook/sign-in-with-username-and-password/$express.md | 2 +- .../guidebook/sign-in-with-username-and-password/$hono.md | 2 +- .../guidebook/sign-in-with-username-and-password/$nextjs-app.md | 2 +- .../sign-in-with-username-and-password/$nextjs-pages.md | 2 +- .../guidebook/sign-in-with-username-and-password/$nuxt.md | 2 +- .../guidebook/sign-in-with-username-and-password/index.md | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/documentation/content/guidebook/email-verification-links/index.md b/documentation/content/guidebook/email-verification-links/index.md index 7a8cbe5a3..7f87b1d7b 100644 --- a/documentation/content/guidebook/email-verification-links/index.md +++ b/documentation/content/guidebook/email-verification-links/index.md @@ -291,7 +291,7 @@ post("/login", async (request: Request) => { // and validate password const key = await auth.useKey("email", email.toLowerCase(), password); const session = await auth.createSession({ - userId: user.userId, + userId: key.userId, attributes: {} }); const sessionCookie = auth.createSessionCookie(session); diff --git a/documentation/content/guidebook/sign-in-with-username-and-password/$express.md b/documentation/content/guidebook/sign-in-with-username-and-password/$express.md index ccc2f34c7..b62d6e29d 100644 --- a/documentation/content/guidebook/sign-in-with-username-and-password/$express.md +++ b/documentation/content/guidebook/sign-in-with-username-and-password/$express.md @@ -213,7 +213,7 @@ app.post("/login", async (req, res) => { // and validate password const key = await auth.useKey("username", username.toLowerCase(), password); const session = await auth.createSession({ - userId: user.userId, + userId: key.userId, attributes: {} }); const authRequest = auth.handleRequest(req, res); diff --git a/documentation/content/guidebook/sign-in-with-username-and-password/$hono.md b/documentation/content/guidebook/sign-in-with-username-and-password/$hono.md index faa82c1ea..6f9943d40 100644 --- a/documentation/content/guidebook/sign-in-with-username-and-password/$hono.md +++ b/documentation/content/guidebook/sign-in-with-username-and-password/$hono.md @@ -189,7 +189,7 @@ app.post("/login", async (context) => { // and validate password const key = await auth.useKey("username", username.toLowerCase(), password); const session = await auth.createSession({ - userId: user.userId, + userId: key.userId, attributes: {} }); const authRequest = auth.handleRequest(context); diff --git a/documentation/content/guidebook/sign-in-with-username-and-password/$nextjs-app.md b/documentation/content/guidebook/sign-in-with-username-and-password/$nextjs-app.md index ae975305d..c145abb68 100644 --- a/documentation/content/guidebook/sign-in-with-username-and-password/$nextjs-app.md +++ b/documentation/content/guidebook/sign-in-with-username-and-password/$nextjs-app.md @@ -409,7 +409,7 @@ export const POST = async (request: NextRequest) => { // and validate password const key = await auth.useKey("username", username.toLowerCase(), password); const session = await auth.createSession({ - userId: user.userId, + userId: key.userId, attributes: {} }); const authRequest = auth.handleRequest({ diff --git a/documentation/content/guidebook/sign-in-with-username-and-password/$nextjs-pages.md b/documentation/content/guidebook/sign-in-with-username-and-password/$nextjs-pages.md index ba42e7fec..57f364a04 100644 --- a/documentation/content/guidebook/sign-in-with-username-and-password/$nextjs-pages.md +++ b/documentation/content/guidebook/sign-in-with-username-and-password/$nextjs-pages.md @@ -365,7 +365,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => { // and validate password const key = await auth.useKey("username", username.toLowerCase(), password); const session = await auth.createSession({ - userId: user.userId, + userId: key.userId, attributes: {} }); const authRequest = auth.handleRequest({ diff --git a/documentation/content/guidebook/sign-in-with-username-and-password/$nuxt.md b/documentation/content/guidebook/sign-in-with-username-and-password/$nuxt.md index a96ed40c8..d079e5d69 100644 --- a/documentation/content/guidebook/sign-in-with-username-and-password/$nuxt.md +++ b/documentation/content/guidebook/sign-in-with-username-and-password/$nuxt.md @@ -286,7 +286,7 @@ export default defineEventHandler(async (event) => { // and validate password const key = await auth.useKey("username", username.toLowerCase(), password); const session = await auth.createSession({ - userId: user.userId, + userId: key.userId, attributes: {} }); const authRequest = auth.handleRequest(event); diff --git a/documentation/content/guidebook/sign-in-with-username-and-password/index.md b/documentation/content/guidebook/sign-in-with-username-and-password/index.md index 753822350..4f48004a8 100644 --- a/documentation/content/guidebook/sign-in-with-username-and-password/index.md +++ b/documentation/content/guidebook/sign-in-with-username-and-password/index.md @@ -222,7 +222,7 @@ post("/login", async (request: Request) => { // and validate password const key = await auth.useKey("username", username.toLowerCase(), password); const session = await auth.createSession({ - userId: user.userId, + userId: key.userId, attributes: {} }); const sessionCookie = auth.createSessionCookie(session);