From 97ddae64f9fad780f82c2eb019d40abfb33a6bb2 Mon Sep 17 00:00:00 2001 From: lucythecat Date: Sat, 9 Dec 2023 10:24:15 +0900 Subject: [PATCH] format --- documentation/README.md | 2 +- documentation/astro.config.mjs | 16 ++--- documentation/package.json | 42 ++++++------- documentation/src/components/Head.astro | 3 +- .../src/components/MarkdownArticle.astro | 4 +- documentation/src/env.d.ts | 2 +- documentation/src/layouts/BaseLayout.astro | 62 +++++++++---------- .../pages/guides/email-and-password/2fa.md | 2 +- .../email-verification-links.md | 1 - .../email-and-password/login-throttling.md | 2 +- .../src/pages/guides/oauth/account-linking.md | 2 +- documentation/src/pages/guides/oauth/index.md | 2 +- documentation/src/pages/index.astro | 29 +++++---- .../main/Lucia/createBlankSessionCookie.md | 4 +- .../src/pages/reference/main/Lucia/index.md | 14 ++--- .../reference/main/Lucia/invalidateSession.md | 2 +- .../main/Lucia/invalidateUserSessions.md | 2 +- .../reference/main/Lucia/readBearerToken.md | 4 +- .../reference/main/Lucia/readSessionCookie.md | 2 +- .../src/pages/reference/main/Scrypt/index.md | 2 +- .../src/pages/reference/main/Session.md | 3 +- .../src/pages/reference/main/SessionCookie.md | 2 +- .../src/pages/reference/main/TimeSpan.md | 2 +- .../src/pages/tutorials/github-oauth/index.md | 2 +- .../tutorials/username-and-password/index.md | 2 +- .../src/pages/upgrade-v3/mongoose.md | 2 +- .../src/pages/upgrade-v3/prisma/index.md | 2 +- documentation/tsconfig.json | 18 +++--- 28 files changed, 119 insertions(+), 113 deletions(-) diff --git a/documentation/README.md b/documentation/README.md index 9f1cc426b..5f7637e99 100644 --- a/documentation/README.md +++ b/documentation/README.md @@ -2,4 +2,4 @@ ``` pnpm dev -``` \ No newline at end of file +``` diff --git a/documentation/astro.config.mjs b/documentation/astro.config.mjs index b35821fbb..2ef671960 100644 --- a/documentation/astro.config.mjs +++ b/documentation/astro.config.mjs @@ -1,13 +1,13 @@ -import { defineConfig } from 'astro/config'; +import { defineConfig } from "astro/config"; import tailwind from "@astrojs/tailwind"; // https://astro.build/config export default defineConfig({ - markdown: { - shikiConfig: { - "theme": "css-variables" - } - }, - integrations: [tailwind()] -}); \ No newline at end of file + markdown: { + shikiConfig: { + theme: "css-variables" + } + }, + integrations: [tailwind()] +}); diff --git a/documentation/package.json b/documentation/package.json index 6d6bcd3de..28d61fc14 100644 --- a/documentation/package.json +++ b/documentation/package.json @@ -1,22 +1,22 @@ { - "name": "documentation-v3", - "type": "module", - "version": "0.0.1", - "scripts": { - "dev": "astro dev", - "start": "astro dev", - "build": "astro check && astro build", - "preview": "astro preview", - "astro": "astro" - }, - "dependencies": { - "@astrojs/tailwind": "^5.0.0", - "astro": "^3.5.5", - "tailwindcss": "^3.0.24" - }, - "devDependencies": { - "@astrojs/check": "^0.3.1", - "@tailwindcss/typography": "^0.5.10", - "typescript": "^5.2.2" - } -} \ No newline at end of file + "name": "documentation-v3", + "type": "module", + "version": "0.0.1", + "scripts": { + "dev": "astro dev", + "start": "astro dev", + "build": "astro check && astro build", + "preview": "astro preview", + "astro": "astro" + }, + "dependencies": { + "@astrojs/tailwind": "^5.0.0", + "astro": "^3.5.5", + "tailwindcss": "^3.0.24" + }, + "devDependencies": { + "@astrojs/check": "^0.3.1", + "@tailwindcss/typography": "^0.5.10", + "typescript": "^5.2.2" + } +} diff --git a/documentation/src/components/Head.astro b/documentation/src/components/Head.astro index b6bcf16d0..309470de8 100644 --- a/documentation/src/components/Head.astro +++ b/documentation/src/components/Head.astro @@ -3,6 +3,7 @@ interface Props { title: string; } --- + @@ -25,4 +26,4 @@ interface Props { property="og:description" content="Lucia is an open source auth library that abstracts away the complexity of handling sessions." /> - \ No newline at end of file + diff --git a/documentation/src/components/MarkdownArticle.astro b/documentation/src/components/MarkdownArticle.astro index 8e09110f8..cbf01959a 100644 --- a/documentation/src/components/MarkdownArticle.astro +++ b/documentation/src/components/MarkdownArticle.astro @@ -1,4 +1,4 @@ -
+
@@ -28,7 +28,7 @@ @apply text-sm; } :global(.md pre code a) { - @apply underline decoration-main hover:text-main hover:no-underline; + @apply decoration-main hover:text-main underline hover:no-underline; } :global(.md pre) { @apply mb-6 mt-4 w-full overflow-auto rounded-md bg-zinc-100 p-4 text-sm leading-snug; diff --git a/documentation/src/env.d.ts b/documentation/src/env.d.ts index 5b0a7e0c5..9c03f0a2c 100644 --- a/documentation/src/env.d.ts +++ b/documentation/src/env.d.ts @@ -1,2 +1,2 @@ /// -/// \ No newline at end of file +/// diff --git a/documentation/src/layouts/BaseLayout.astro b/documentation/src/layouts/BaseLayout.astro index 4b5b436d7..bde65f068 100644 --- a/documentation/src/layouts/BaseLayout.astro +++ b/documentation/src/layouts/BaseLayout.astro @@ -4,7 +4,6 @@ import NavMenu from "@components/NavMenu.astro"; import type { Section } from "@components/NavMenu.astro"; - interface Props { title: string; sections: Section[]; @@ -13,46 +12,47 @@ interface Props { - +
-
- - - + + + + diff --git a/documentation/src/pages/guides/email-and-password/2fa.md b/documentation/src/pages/guides/email-and-password/2fa.md index 578821620..806f49d8a 100644 --- a/documentation/src/pages/guides/email-and-password/2fa.md +++ b/documentation/src/pages/guides/email-and-password/2fa.md @@ -40,7 +40,7 @@ declare module "lucia" { ## Create QR code -When the user signs up, set `two_factor_secret` to `null` to indicate the user has yet to set up two-factor authorization. +When the user signs up, set `two_factor_secret` to `null` to indicate the user has yet to set up two-factor authorization. ```ts app.post("/signup", async () => { diff --git a/documentation/src/pages/guides/email-and-password/email-verification-links.md b/documentation/src/pages/guides/email-and-password/email-verification-links.md index 1b42c5a01..c9dff2255 100644 --- a/documentation/src/pages/guides/email-and-password/email-verification-links.md +++ b/documentation/src/pages/guides/email-and-password/email-verification-links.md @@ -115,7 +115,6 @@ Extract the email verification token from the URL and validate by checking the e import { isWithinExpiration } from "oslo"; app.get("email-verification/*", async () => { - // ... // there are better ways to do this - check your framework's API diff --git a/documentation/src/pages/guides/email-and-password/login-throttling.md b/documentation/src/pages/guides/email-and-password/login-throttling.md index 646ca20f0..74931b1a0 100644 --- a/documentation/src/pages/guides/email-and-password/login-throttling.md +++ b/documentation/src/pages/guides/email-and-password/login-throttling.md @@ -5,4 +5,4 @@ title: "Login throttling" ``` still working on this one! -``` \ No newline at end of file +``` diff --git a/documentation/src/pages/guides/oauth/account-linking.md b/documentation/src/pages/guides/oauth/account-linking.md index 5651821c6..3514f6f5b 100644 --- a/documentation/src/pages/guides/oauth/account-linking.md +++ b/documentation/src/pages/guides/oauth/account-linking.md @@ -5,4 +5,4 @@ title: "Account linking" ``` still working on this one! -``` \ No newline at end of file +``` diff --git a/documentation/src/pages/guides/oauth/index.md b/documentation/src/pages/guides/oauth/index.md index 041cba0c1..66ebcf23b 100644 --- a/documentation/src/pages/guides/oauth/index.md +++ b/documentation/src/pages/guides/oauth/index.md @@ -11,4 +11,4 @@ For a step-by-step, framework specific tutorial, see the [GitHub OAuth]() tutori - [Multiple OAuth providers](/guides/oauth/multiple-providers) - [PKCE](/guides/oauth/pkce) - [Account linking](/guides/oauth/account-linking) -- [Custom OAuth providers](/guides/oauth/custom-providers) \ No newline at end of file +- [Custom OAuth providers](/guides/oauth/custom-providers) diff --git a/documentation/src/pages/index.astro b/documentation/src/pages/index.astro index fcf2883ad..f9bc8e47f 100644 --- a/documentation/src/pages/index.astro +++ b/documentation/src/pages/index.astro @@ -15,31 +15,38 @@ const contributors = await getGithubContributors(); --- -

Lucia
Auth, simple and clean

+

+ Lucia
Auth, simple and clean +

Lucia is an auth library that abstracts away the complexity of handling sessions. It works alongside your database to provide an API that's easy to use, understand, and extend. Get started →Get started →

-

It just works

+

It just works

    -
  • No more endless configuration and callbacks
  • -
  • Fully typed
  • -
  • Works in any runtime - Node.js, Bun, Deno, Cloudflare Workers
  • -
  • Extensive database support
  • -
  • Built-in support for popular frameworks
  • -
  • Comprehensive documentation and guides
  • +
  • + No more endless configuration and callbacks +
  • +
  • Fully typed
  • +
  • + Works in any runtime - Node.js, Bun, Deno, Cloudflare + Workers +
  • +
  • Extensive database support
  • +
  • Built-in support for popular frameworks
  • +
  • Comprehensive documentation and guides
-

Free and open source

+

Free and open source

Lucia is a free and open source project, made possible by our contributors!

-
+
{ contributors.map((contributor) => { return ( diff --git a/documentation/src/pages/reference/main/Lucia/createBlankSessionCookie.md b/documentation/src/pages/reference/main/Lucia/createBlankSessionCookie.md index 895bbece2..87b6d2e31 100644 --- a/documentation/src/pages/reference/main/Lucia/createBlankSessionCookie.md +++ b/documentation/src/pages/reference/main/Lucia/createBlankSessionCookie.md @@ -4,11 +4,11 @@ title: "Lucia.createBlankSessionCookie()" format: "code" --- -Method of [`Lucia`](/reference/main/Lucia). Creates a new cookie with a blank value that expires immediately to delete the existing session cookie. +Method of [`Lucia`](/reference/main/Lucia). Creates a new cookie with a blank value that expires immediately to delete the existing session cookie. ## Definition ```ts //$ SessionCookie=/reference/main/SessionCookie function createBlankSessionCookie(): $$SessionCookie; -``` \ No newline at end of file +``` diff --git a/documentation/src/pages/reference/main/Lucia/index.md b/documentation/src/pages/reference/main/Lucia/index.md index 593993c60..1fc35c7bb 100644 --- a/documentation/src/pages/reference/main/Lucia/index.md +++ b/documentation/src/pages/reference/main/Lucia/index.md @@ -44,13 +44,13 @@ function constructor< - `options`: - `sessionExpiresIn`: How long a session lasts for maximum for inactive users - `sessionCookie`: Session cookie options - - `name`: Cookie name (default: `auth_session`) - - `expires`: Set to `false` for cookies to persist indefinitely (default: `true`) - - `attributes`: Cookie attributes - - `sameSite` - - `domain` - - `path` - - `secure` + - `name`: Cookie name (default: `auth_session`) + - `expires`: Set to `false` for cookies to persist indefinitely (default: `true`) + - `attributes`: Cookie attributes + - `sameSite` + - `domain` + - `path` + - `secure` - `getSessionAttributes()`: Transforms database session attributes and the returned object is added to the [`Session`](/reference/main/Session) object - `getUserAttributes()`: Transforms database user attributes and the returned object is added to the [`User`](/reference/main/User) object diff --git a/documentation/src/pages/reference/main/Lucia/invalidateSession.md b/documentation/src/pages/reference/main/Lucia/invalidateSession.md index ab874a401..1614b11d8 100644 --- a/documentation/src/pages/reference/main/Lucia/invalidateSession.md +++ b/documentation/src/pages/reference/main/Lucia/invalidateSession.md @@ -9,7 +9,7 @@ Method of [`Lucia`](/reference/main/Lucia). Invalidates a session. ## Definition ```ts -function invalidateSession(sessionId: string): Promise +function invalidateSession(sessionId: string): Promise; ``` ### Parameters diff --git a/documentation/src/pages/reference/main/Lucia/invalidateUserSessions.md b/documentation/src/pages/reference/main/Lucia/invalidateUserSessions.md index e11d92974..0aec52389 100644 --- a/documentation/src/pages/reference/main/Lucia/invalidateUserSessions.md +++ b/documentation/src/pages/reference/main/Lucia/invalidateUserSessions.md @@ -9,7 +9,7 @@ Method of [`Lucia`](/reference/main/Lucia). Invalidates all sessions of a user. ## Definition ```ts -function invalidateUserSessions(userId: string): Promise +function invalidateUserSessions(userId: string): Promise; ``` ### Parameters diff --git a/documentation/src/pages/reference/main/Lucia/readBearerToken.md b/documentation/src/pages/reference/main/Lucia/readBearerToken.md index c0effaaaf..390bf980c 100644 --- a/documentation/src/pages/reference/main/Lucia/readBearerToken.md +++ b/documentation/src/pages/reference/main/Lucia/readBearerToken.md @@ -4,12 +4,12 @@ title: "Lucia.readBearerToken()" format: "code" --- -Method of [`Lucia`](/reference/main/Lucia). Reads the bearer token from the `Authorization`` header. Returns `null` if the token doesn't exist. +Method of [`Lucia`](/reference/main/Lucia). Reads the bearer token from the ` Authorization`` header. Returns `null` if the token doesn't exist. ## Definition ```ts -function readBearerToken(authorizationHeader: string): string | null +function readBearerToken(authorizationHeader: string): string | null; ``` ### Parameters diff --git a/documentation/src/pages/reference/main/Lucia/readSessionCookie.md b/documentation/src/pages/reference/main/Lucia/readSessionCookie.md index ebe45532f..63b4c18fe 100644 --- a/documentation/src/pages/reference/main/Lucia/readSessionCookie.md +++ b/documentation/src/pages/reference/main/Lucia/readSessionCookie.md @@ -9,7 +9,7 @@ Method of [`Lucia`](/reference/main/Lucia). Reads the session cookie from the `C ## Definition ```ts -function readSessionCookie(cookieHeader: string): string | null +function readSessionCookie(cookieHeader: string): string | null; ``` ### Parameters diff --git a/documentation/src/pages/reference/main/Scrypt/index.md b/documentation/src/pages/reference/main/Scrypt/index.md index 21358fdac..5b5e5bfa1 100644 --- a/documentation/src/pages/reference/main/Scrypt/index.md +++ b/documentation/src/pages/reference/main/Scrypt/index.md @@ -4,7 +4,7 @@ title: "Scrypt" format: "code" --- -A pure JS implementation of Scrypt. Provides methods for hashing passwords and verifying hashes with [scrypt](https://datatracker.ietf.org/doc/html/rfc7914). By default, the configuration is set to [the recommended values](https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html). +A pure JS implementation of Scrypt. Provides methods for hashing passwords and verifying hashes with [scrypt](https://datatracker.ietf.org/doc/html/rfc7914). By default, the configuration is set to [the recommended values](https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html). The output hash is a combination of the scrypt hash and the 32-bytes salt, in the format of `:`. diff --git a/documentation/src/pages/reference/main/Session.md b/documentation/src/pages/reference/main/Session.md index abc4065e5..53c62146e 100644 --- a/documentation/src/pages/reference/main/Session.md +++ b/documentation/src/pages/reference/main/Session.md @@ -18,10 +18,9 @@ interface Session extends SessionAttributes { } ``` - ### Properties - `id` - `expiresAt` - `fresh`: `true` if session was newly created or its expiration was extended -- `userId` \ No newline at end of file +- `userId` diff --git a/documentation/src/pages/reference/main/SessionCookie.md b/documentation/src/pages/reference/main/SessionCookie.md index 2d213d9bb..73739c88a 100644 --- a/documentation/src/pages/reference/main/SessionCookie.md +++ b/documentation/src/pages/reference/main/SessionCookie.md @@ -4,4 +4,4 @@ title: "SessionCookie" format: "code" --- -See [`SessionCookie`](https://oslo.js.org/reference/main/session/SessionCookie/) from `oslo/session`. \ No newline at end of file +See [`SessionCookie`](https://oslo.js.org/reference/main/session/SessionCookie/) from `oslo/session`. diff --git a/documentation/src/pages/reference/main/TimeSpan.md b/documentation/src/pages/reference/main/TimeSpan.md index 672154553..8508a7abe 100644 --- a/documentation/src/pages/reference/main/TimeSpan.md +++ b/documentation/src/pages/reference/main/TimeSpan.md @@ -4,4 +4,4 @@ title: "TimeSpan" format: "code" --- -See [`TimeSpan`](https://oslo.js.org/reference/main/main/TimeSpan/) from `oslo`. \ No newline at end of file +See [`TimeSpan`](https://oslo.js.org/reference/main/main/TimeSpan/) from `oslo`. diff --git a/documentation/src/pages/tutorials/github-oauth/index.md b/documentation/src/pages/tutorials/github-oauth/index.md index ca88bddde..31276c1dd 100644 --- a/documentation/src/pages/tutorials/github-oauth/index.md +++ b/documentation/src/pages/tutorials/github-oauth/index.md @@ -5,4 +5,4 @@ title: "GitHub OAuth" ``` still working on this one! -``` \ No newline at end of file +``` diff --git a/documentation/src/pages/tutorials/username-and-password/index.md b/documentation/src/pages/tutorials/username-and-password/index.md index a4a2ddcb3..711de0084 100644 --- a/documentation/src/pages/tutorials/username-and-password/index.md +++ b/documentation/src/pages/tutorials/username-and-password/index.md @@ -5,4 +5,4 @@ title: "Username and password" ``` still working on this one! -``` \ No newline at end of file +``` diff --git a/documentation/src/pages/upgrade-v3/mongoose.md b/documentation/src/pages/upgrade-v3/mongoose.md index 96148fffb..5f96b4f5e 100644 --- a/documentation/src/pages/upgrade-v3/mongoose.md +++ b/documentation/src/pages/upgrade-v3/mongoose.md @@ -1,4 +1,4 @@ --- layout: "@layouts/DocLayout.astro" title: "Upgrade your Mongoose project to v3" ---- \ No newline at end of file +--- diff --git a/documentation/src/pages/upgrade-v3/prisma/index.md b/documentation/src/pages/upgrade-v3/prisma/index.md index 9bdcf6129..03ac42d0f 100644 --- a/documentation/src/pages/upgrade-v3/prisma/index.md +++ b/documentation/src/pages/upgrade-v3/prisma/index.md @@ -17,7 +17,7 @@ Initialize the adapter: import { PrismaClient } from "@prisma/client"; import { PrismaAdapter } from "@lucia-auth/adapter-prisma"; -const client = new PrismaClient() +const client = new PrismaClient(); new PrismaAdapter(client.session, client.user); ``` diff --git a/documentation/tsconfig.json b/documentation/tsconfig.json index 12c09935f..09edf4ea0 100644 --- a/documentation/tsconfig.json +++ b/documentation/tsconfig.json @@ -1,10 +1,10 @@ { - "extends": "astro/tsconfigs/strict", - "compilerOptions": { - "baseUrl": ".", - "paths": { - "@layouts/*": ["src/layouts/*"], - "@components/*": ["src/components/*"] - } - } -} \ No newline at end of file + "extends": "astro/tsconfigs/strict", + "compilerOptions": { + "baseUrl": ".", + "paths": { + "@layouts/*": ["src/layouts/*"], + "@components/*": ["src/components/*"] + } + } +}