@springmicro/auth
TypeScript icon, indicating that this package has built-in type declarations

0.5.16 • Public • Published

@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

Readme

Keywords

none

Package Sidebar

Install

npm i @springmicro/auth

Weekly Downloads

36

Version

0.5.16

License

none

Unpacked Size

5.35 MB

Total Files

143

Last publish

Collaborators

  • springmicro