From 21505b06d6c32d20c05a9c85ca079e4d9c7e0541 Mon Sep 17 00:00:00 2001 From: Doruk Gezici Date: Sun, 8 Oct 2023 02:06:26 +0200 Subject: [PATCH] Ability to disable injecting OAuth routes fixes #2 --- README.md | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0920b4a..feb5b18 100644 --- a/README.md +++ b/README.md @@ -73,8 +73,33 @@ OAUTH_GITHUB_CLIENT_ID= OAUTH_GITHUB_CLIENT_SECRET= ``` -## Configuration +## Configuration Options -While being fully functional, this library doesn't provide any configuration options yet except providing your own `config.yml` file in `public/admin` for Decap CMS. +```js +export interface DecapCMSOptions { + adminRoute?: string; + oauthDisabled?: boolean; + oauthLoginRoute?: string; + oauthCallbackRoute?: string; +} + +const defaultOptions: DecapCMSOptions = { + adminRoute: "/admin", + oauthDisabled: false, + oauthLoginRoute: "/oauth", + oauthCallbackRoute: "/oauth/callback", +}; +``` + +To disable injecting OAuth routes, set `oauthDisabled` to `true` in `astro.config.mjs`. + +```js +import { defineConfig } from "astro/config"; +import { decapCmsOauth } from "astro-decap-cms-oauth"; -I plan to add some options for the integration in the future, contributions are welcome as well! +export default defineConfig({ + ..., + integrations: [decapCmsOauth({ oauthDisabled: true })], + output: "server", +}); +```