|
1 | | -import { SvelteKitAuth } from "@auth/sveltekit" |
2 | | -import GitHub from "@auth/sveltekit/providers/github" |
3 | | -import Credentials from "@auth/sveltekit/providers/credentials" |
4 | | -import Facebook from "@auth/sveltekit/providers/facebook" |
5 | | -import Auth0 from "@auth/sveltekit/providers/auth0" |
6 | | -import Discord from "@auth/sveltekit/providers/discord" |
7 | | -import Email from "@auth/sveltekit/providers/email" |
8 | | -import Google from "@auth/sveltekit/providers/google" |
9 | | -import Twitter from "@auth/sveltekit/providers/twitter" |
10 | | -import LinkedIn from "@auth/sveltekit/providers/linkedin" |
11 | | -import Instagram from "@auth/sveltekit/providers/instagram" |
12 | | -import Okta from "@auth/sveltekit/providers/okta" |
13 | | -import Apple from "@auth/sveltekit/providers/apple" |
14 | | -import Slack from "@auth/sveltekit/providers/slack" |
15 | | -import Twitch from "@auth/sveltekit/providers/twitch" |
16 | | -import Cognito from "@auth/sveltekit/providers/cognito" |
17 | | -import AzureAD from "@auth/sveltekit/providers/azure-ad" |
18 | | -import Reddit from "@auth/sveltekit/providers/reddit" |
19 | | -import Spotify from "@auth/sveltekit/providers/spotify" |
20 | | -import { |
21 | | - GITHUB_ID, |
22 | | - GITHUB_SECRET, |
23 | | - FACEBOOK_ID, |
24 | | - FACEBOOK_SECRET, |
25 | | - AUTH0_ID, |
26 | | - AUTH0_SECRET, |
27 | | - AUTH0_ISSUER, |
28 | | - DISCORD_ID, |
29 | | - DISCORD_SECRET, |
30 | | - GOOGLE_ID, |
31 | | - GOOGLE_SECRET, |
32 | | - TWITTER_ID, |
33 | | - TWITTER_SECRET, |
34 | | - LINKEDIN_ID, |
35 | | - LINKEDIN_SECRET, |
36 | | - INSTAGRAM_ID, |
37 | | - INSTAGRAM_SECRET, |
38 | | - OKTA_ID, |
39 | | - OKTA_SECRET, |
40 | | - OKTA_ISSUER, |
41 | | - APPLE_ID, |
42 | | - APPLE_SECRET, |
43 | | - SLACK_ID, |
44 | | - SLACK_SECRET, |
45 | | - TWITCH_ID, |
46 | | - TWITCH_SECRET, |
47 | | - COGNITO_ID, |
48 | | - COGNITO_SECRET, |
49 | | - COGNITO_ISSUER, |
50 | | - AZURE_AD_ID, |
51 | | - AZURE_AD_SECRET, |
52 | | - REDDIT_ID, |
53 | | - REDDIT_SECRET, |
54 | | - SPOTIFY_ID, |
55 | | - SPOTIFY_SECRET, |
56 | | -} from "$env/static/private" |
57 | | -import { TestAdapter } from "$lib/adapter" |
58 | | - |
59 | | -const db: Record<string, any> = {} |
60 | | - |
61 | | -const adapter = TestAdapter({ |
62 | | - getItem(key) { |
63 | | - return db[key] |
64 | | - }, |
65 | | - setItem: function (key: string, value: string): Promise<void> { |
66 | | - db[key] = value |
67 | | - return Promise.resolve() |
68 | | - }, |
69 | | - deleteItems: function (...keys: string[]): Promise<void> { |
70 | | - keys.forEach((key) => delete db[key]) |
71 | | - return Promise.resolve() |
72 | | - }, |
73 | | -}) |
74 | | -export const handle = SvelteKitAuth({ |
75 | | - adapter, |
76 | | - session: { |
77 | | - strategy: "jwt", |
78 | | - }, |
79 | | - providers: [ |
80 | | - Email({ server: "smtp://127.0.0.1:1025?tls.rejectUnauthorized=false" }), |
81 | | - Credentials({ |
82 | | - credentials: { password: { label: "Password", type: "password" } }, |
83 | | - async authorize(credentials) { |
84 | | - if (credentials.password !== "pw") return null |
85 | | - return { |
86 | | - name: "Fill Murray", |
87 | | - |
88 | | - image: "https://www.fillmurray.com/64/64", |
89 | | - id: "1", |
90 | | - foo: "", |
91 | | - } |
92 | | - }, |
93 | | - }), |
94 | | - Google({ |
95 | | - clientId: GOOGLE_ID, |
96 | | - clientSecret: GOOGLE_SECRET, |
97 | | - }), |
98 | | - Facebook({ clientId: FACEBOOK_ID, clientSecret: FACEBOOK_SECRET }), |
99 | | - GitHub({ clientId: GITHUB_ID, clientSecret: GITHUB_SECRET }), |
100 | | - Discord({ |
101 | | - clientId: DISCORD_ID, |
102 | | - clientSecret: DISCORD_SECRET, |
103 | | - }), |
104 | | - Twitter({ |
105 | | - clientId: TWITTER_ID, |
106 | | - clientSecret: TWITTER_SECRET, |
107 | | - }), |
108 | | - Slack({ |
109 | | - clientId: SLACK_ID, |
110 | | - clientSecret: SLACK_SECRET, |
111 | | - }), |
112 | | - LinkedIn({ |
113 | | - clientId: LINKEDIN_ID, |
114 | | - clientSecret: LINKEDIN_SECRET, |
115 | | - }), |
116 | | - Okta({ |
117 | | - clientId: OKTA_ID, |
118 | | - clientSecret: OKTA_SECRET, |
119 | | - issuer: OKTA_ISSUER, |
120 | | - }), |
121 | | - Apple({ |
122 | | - clientId: APPLE_ID, |
123 | | - clientSecret: APPLE_SECRET, |
124 | | - }), |
125 | | - Auth0({ |
126 | | - clientId: AUTH0_ID, |
127 | | - clientSecret: AUTH0_SECRET, |
128 | | - issuer: AUTH0_ISSUER, |
129 | | - }), |
130 | | - Spotify({ |
131 | | - clientId: SPOTIFY_ID, |
132 | | - clientSecret: SPOTIFY_SECRET, |
133 | | - }), |
134 | | - Instagram({ |
135 | | - clientId: INSTAGRAM_ID, |
136 | | - clientSecret: INSTAGRAM_SECRET, |
137 | | - }), |
138 | | - Cognito({ |
139 | | - clientId: COGNITO_ID, |
140 | | - clientSecret: COGNITO_SECRET, |
141 | | - issuer: COGNITO_ISSUER, |
142 | | - }), |
143 | | - Twitch({ |
144 | | - clientId: TWITCH_ID, |
145 | | - clientSecret: TWITCH_SECRET, |
146 | | - }), |
147 | | - Reddit({ |
148 | | - clientId: REDDIT_ID, |
149 | | - clientSecret: REDDIT_SECRET, |
150 | | - }), |
151 | | - AzureAD({ |
152 | | - clientId: AZURE_AD_ID, |
153 | | - clientSecret: AZURE_AD_SECRET, |
154 | | - }), |
155 | | - ], |
156 | | - theme: { |
157 | | - logo: "https://authjs.dev/img/logo/logo-sm.webp", |
158 | | - }, |
159 | | -}) |
| 1 | +export { handle } from "./auth" |
0 commit comments