Skip to content

Commit

Permalink
Ability to disable injecting OAuth routes fixes #2
Browse files Browse the repository at this point in the history
  • Loading branch information
dorukgezici committed Oct 8, 2023
1 parent 49e2bed commit 21505b0
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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",
});
```

0 comments on commit 21505b0

Please sign in to comment.