mirror of
https://github.com/SrIzan10/next-auth.git
synced 2026-05-01 10:55:20 +00:00
- Cleans up logging. Logs are now color-coded, added more debug logs, and errors can include some simple metadata (like provider id) to know which provider caused an issue. - All errors are exposed via `@auth/core/errors`. Each error has a URL like: https://errors.authjs.dev#errorcode in the terminal, which points to the documentation explaining the problem in detail, suggesting a fix. - Added a bunch of documentation that autogenerates the pages under https://authjs.dev/reference/core/modules/main - Renames `AuthHandler` to `Auth` and `AuthOptions` to `AuthConfig` - Throwing an error in `signIn` callback will now be caught as a general error and will redirect to `/error?error=Configuration`. If the callback returns `false`, it will redirect to `/error?error=AccessDenied`.
23 lines
568 B
JavaScript
23 lines
568 B
JavaScript
import fs from "fs"
|
|
import path from "path"
|
|
import postcss from "postcss"
|
|
|
|
import autoprefixer from "autoprefixer"
|
|
import postCssNested from "postcss-nested"
|
|
import cssNano from "cssnano"
|
|
|
|
const from = path.join(process.cwd(), "src/lib/pages/styles.css")
|
|
const css = fs.readFileSync(from)
|
|
|
|
const processedCss = await postcss([
|
|
autoprefixer,
|
|
postCssNested,
|
|
cssNano({ preset: "default" }),
|
|
]).process(css, { from })
|
|
|
|
fs.writeFileSync(
|
|
path.join(process.cwd(), "src/lib/pages/styles.ts"),
|
|
`export default \`${processedCss.css}\`
|
|
// Generated by \`pnpm css\``
|
|
)
|