@m1212e/sveltekit-oidc
TypeScript icon, indicating that this package has built-in type declarations

0.0.31 • Public • Published

svletekit-oidc

Implementing OIDC with Sveltekit never has been easier:

In your hooks.server.ts

import { sequence } from '@sveltejs/kit/hooks';

export const OIDC = await makeOIDC({
	oidcAuthority: PUBLIC_OIDC_AUTHORITY,
	oidcClientId: PUBLIC_OIDC_CLIENT_ID,
	secret: OIDC_CLIENT_SECRET,
	authenticatedRoutes: ['/app'],
	async userLoggedInSuccessfully(user) {
		upsertUserAtDatabase();
	}
});

export const handle: Handle = sequence(OIDC.handle, otherHandler);

Now the user is available via the locals on your server.

Readme

Keywords

Package Sidebar

Install

npm i @m1212e/sveltekit-oidc

Weekly Downloads

81

Version

0.0.31

License

none

Unpacked Size

32.7 kB

Total Files

12

Last publish

Collaborators

  • m1212e