Skip to content
This repository has been archived by the owner on Dec 9, 2023. It is now read-only.

Commit

Permalink
ci: 📦 fix ci package
Browse files Browse the repository at this point in the history
  • Loading branch information
willin committed Dec 4, 2023
1 parent 5a66097 commit a58df51
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"devDependencies": {
"@commitlint/cli": "latest",
"@commitlint/config-conventional": "latest",
"@svelte-dev/auth-sso": "latest",
"@svelte-dev/auth-sso": "^0.0.3",
"@sveltejs/adapter-cloudflare": "^2.3.3",
"@sveltejs/kit": "^1.27.4",
"@sveltejs/package": "^2.2.3",
Expand Down
2 changes: 1 addition & 1 deletion src/hooks.server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Handle } from '@sveltejs/kit';
import { authenticator } from './routes/sso.server.js';
import { authenticator } from './sso.js';

export const handle: Handle = async ({ event, resolve }) => {
const user = await authenticator.isAuthenticated(event);
Expand Down
2 changes: 1 addition & 1 deletion src/routes/auth/[provider]/+server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { redirect } from '@sveltejs/kit';
import { authenticator } from '../../sso.server.js';
import { authenticator } from '../../../sso.js';
import type { RequestHandler } from './$types.js';

export const GET: RequestHandler = async (event) => {
Expand Down
2 changes: 1 addition & 1 deletion src/routes/auth/[provider]/callback/+server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { authenticator } from '../../../sso.server.js';
import { authenticator } from '../../../../sso.js';
import type { RequestHandler } from './$types.js';

export const GET: RequestHandler = async (event) => {
Expand Down
7 changes: 4 additions & 3 deletions src/routes/sso.server.ts → src/sso.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SSOStrategy } from '@svelte-dev/auth-sso/build/index.js';
import { env } from '$env/dynamic/private';
import { Authenticator } from '$lib/index.js';
import { SSOStrategy } from '@svelte-dev/auth-sso';

const authenticator = new Authenticator({
throwOnError: true
Expand All @@ -13,12 +13,13 @@ const ssoStrategy = new SSOStrategy(
callbackURL: 'http://localhost:8788/auth/sso/callback'
// 'https://svelte-auth.js.cool/auth/sso/callback'
},
async ({ profile }: { profile: Record<string, unknown> }) => {
async ({ profile }) => {
// Get the user data from your DB or API using the tokens and profile
return profile;
}
);

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
authenticator.use(ssoStrategy);

export { authenticator };

0 comments on commit a58df51

Please sign in to comment.