@springmicro/auth
v0.2.0
Published
Auth config supplied for connecting with a Casdoor instance. Uses [auth-astro](https://github.com/nowaythatworked/auth-astro).
Downloads
5
Readme
@springmicro/auth
Auth config supplied for connecting with a Casdoor instance. Uses auth-astro.
Usage
npm i -g @springmicro/cli
springmicro add auth
// auth.config.ts
import { getAuthConfig } from "@springmicro/auth";
export default getAuthConfig({
casdoorEndpoint: import.meta.env.PUBLIC_CASDOOR_ENDPOINT,
clientId: import.meta.env.PUBLIC_CASDOOR_CLIENT_ID,
clientSecret: import.meta.env.CASDOOR_CLIENT_SECRET,
});
auth-astro
requires building your site in server
mode with a platform adapter like @astrojs/node
.
pnpm run astro add node
// astro.config.mjs
export default defineConfig({
output: "server",
adapter: node({
mode: "standalone",
}),
});
Casdoor
In the application
settings, add the callback URL of http://yourhost/callback
. Enable auto signin (optional).
Development
Build
pnpm run build
Install in repo (locally)
# testing it out in a demo project
cd astro-demo-project
pnpm run astro add react
pnpm run astro add auth-astro
pnpm add --workspace @springmicro/auth