sveltekit-auth-example 2.0.0 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/.eslintrc.cjs +19 -7
  2. package/.prettierignore +1 -0
  3. package/.yarn/install-state.gz +0 -0
  4. package/CHANGELOG.md +164 -98
  5. package/README.md +6 -1
  6. package/package.json +67 -66
  7. package/prettier.config.mjs +15 -0
  8. package/src/app.d.ts +31 -29
  9. package/src/app.html +8 -3
  10. package/src/hooks.server.ts +15 -15
  11. package/src/lib/focus.ts +6 -6
  12. package/src/lib/google.ts +48 -49
  13. package/src/lib/server/db.ts +7 -6
  14. package/src/lib/server/sendgrid.ts +11 -11
  15. package/src/routes/+error.svelte +1 -1
  16. package/src/routes/+layout.server.ts +5 -5
  17. package/src/routes/+layout.svelte +133 -100
  18. package/src/routes/admin/+page.server.ts +1 -1
  19. package/src/routes/admin/+page.svelte +2 -2
  20. package/src/routes/api/v1/user/+server.ts +13 -14
  21. package/src/routes/auth/[slug]/+server.ts +11 -6
  22. package/src/routes/auth/forgot/+server.ts +23 -23
  23. package/src/routes/auth/google/+server.ts +44 -45
  24. package/src/routes/auth/reset/+server.ts +1 -1
  25. package/src/routes/auth/reset/[token]/+page.svelte +117 -95
  26. package/src/routes/auth/reset/[token]/+page.ts +4 -4
  27. package/src/routes/forgot/+page.svelte +74 -63
  28. package/src/routes/info/+page.svelte +1 -1
  29. package/src/routes/login/+page.svelte +140 -120
  30. package/src/routes/profile/+page.server.ts +9 -9
  31. package/src/routes/profile/+page.svelte +142 -88
  32. package/src/routes/register/+page.server.ts +3 -2
  33. package/src/routes/register/+page.svelte +159 -104
  34. package/src/routes/teachers/+page.server.ts +5 -5
  35. package/src/routes/teachers/+page.svelte +2 -2
  36. package/src/stores.ts +1 -1
  37. package/svelte.config.js +1 -1
  38. package/.prettierrc +0 -9
package/.eslintrc.cjs CHANGED
@@ -1,20 +1,32 @@
1
1
  module.exports = {
2
2
  root: true,
3
3
  parser: '@typescript-eslint/parser',
4
- extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
5
- plugins: ['svelte3', '@typescript-eslint'],
4
+ extends: [
5
+ 'eslint:recommended',
6
+ 'plugin:@typescript-eslint/recommended',
7
+ 'plugin:svelte/recommended',
8
+ 'prettier'
9
+ ],
10
+ plugins: ['@typescript-eslint'],
6
11
  ignorePatterns: ['*.cjs'],
7
12
  overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
8
- settings: {
9
- 'svelte3/typescript': () => require('typescript')
10
- },
11
13
  parserOptions: {
12
14
  sourceType: 'module',
13
- ecmaVersion: 2020
15
+ ecmaVersion: 2020,
16
+ extraFileExtensions: ['.svelte']
14
17
  },
15
18
  env: {
16
19
  browser: true,
17
20
  es2017: true,
18
21
  node: true
19
- }
22
+ },
23
+ overrides: [
24
+ {
25
+ files: ['*.svelte'],
26
+ parser: 'svelte-eslint-parser',
27
+ parserOptions: {
28
+ parser: '@typescript-eslint/parser'
29
+ }
30
+ }
31
+ ]
20
32
  }
package/.prettierignore CHANGED
@@ -1,5 +1,6 @@
1
1
  .DS_Store
2
2
  node_modules
3
+ .yarn
3
4
  /build
4
5
  /.svelte-kit
5
6
  /package
Binary file
package/CHANGELOG.md CHANGED
@@ -1,215 +1,281 @@
1
1
  # Backlog
2
- * Add password complexity checking on /register and /profile pages (only checks for length currently despite what the pages say)
2
+
3
+ - Add password complexity checking on /register and /profile pages (only checks for length currently despite what the pages say)
4
+
5
+ # 2.0.2
6
+ - fix prettier
7
+
8
+ # 2.0.1
9
+
10
+ - Bump @sveltejs/adapter-node, @sveltejs/kit, @sveltejs/vite-plugin-svelte, svelte, svelte-check, vite, google-auth-library, @types/pg, @typescript-eslint/\*, prettier, sass, vitest
3
11
 
4
12
  # 2.0.0 Upgrade for SvelteKit to 2.0
5
- * Migrated to SvelteKit way of managing cookies (vs. setting headers). The latter no longer works.
6
- * Corrected AuthenticationResult.statusCode type
7
- * Removed throw from SvelteKit functions redirect and error
8
- * Bump @sendgrid/mail, node, yarn, svelte, @sveltejs/kit, @sveltejs/vite-plugin-svelte, svelte-check, google-auth-library, vite, typescript, eslint, eslint-config-prettier, prettier-plugin-svelte, vitest, @types*, @typescript-eslint*, prettier
13
+
14
+ - Migrated to SvelteKit way of managing cookies (vs. setting headers). The latter no longer works.
15
+ - Corrected AuthenticationResult.statusCode type
16
+ - Removed throw from SvelteKit functions redirect and error
17
+ - Bump @sendgrid/mail, node, yarn, svelte, @sveltejs/kit, @sveltejs/vite-plugin-svelte, svelte-check, google-auth-library, vite, typescript, eslint, eslint-config-prettier, prettier-plugin-svelte, vitest, @types*, @typescript-eslint*, prettier
9
18
 
10
19
  # 1.0.59
11
- * Bump pg, sveltekit, @types*, bootstrap, eslint, google-auth-library, sass, svelte, svelte-check, tslib, typescript, vite, vitest
20
+
21
+ - Bump pg, sveltekit, @types\*, bootstrap, eslint, google-auth-library, sass, svelte, svelte-check, tslib, typescript, vite, vitest
12
22
 
13
23
  # 1.0.58
14
- * Bump pg, sveltekit, adapter-node, bootstrap, svelte, sass, jsonwebtoken, google-auth-library, vite, vitest
24
+
25
+ - Bump pg, sveltekit, adapter-node, bootstrap, svelte, sass, jsonwebtoken, google-auth-library, vite, vitest
15
26
 
16
27
  # 1.0.57
17
- * Minor bumps for pg, tslib, typescript
28
+
29
+ - Minor bumps for pg, tslib, typescript
18
30
 
19
31
  # 1.0.56
20
- * Svelte 4, minor updates for other dependencies
32
+
33
+ - Svelte 4, minor updates for other dependencies
21
34
 
22
35
  # 1.0.55
23
- * Add comment to indicate property that should be removed if ssl is turned off on the PostgreSQL server (thanks Brazos)
24
- * Update public.reset_password stored procedure to plpgsql (thanks Brazos)
36
+
37
+ - Add comment to indicate property that should be removed if ssl is turned off on the PostgreSQL server (thanks Brazos)
38
+ - Update public.reset_password stored procedure to plpgsql (thanks Brazos)
25
39
 
26
40
  # 1.0.54
27
- * Bump sveltekit, @types/pg, @typescript*, boostrap, eslint, prettier-plugin-svelte, sass, tslib, typescript, vitest
41
+
42
+ - Bump sveltekit, @types/pg, @typescript\*, boostrap, eslint, prettier-plugin-svelte, sass, tslib, typescript, vitest
28
43
 
29
44
  # 1.0.53
30
- * Fix service-worker.ts typing
31
- * Bump pg, sveltekit, svelte, vite, tslib and other devDependencies
45
+
46
+ - Fix service-worker.ts typing
47
+ - Bump pg, sveltekit, svelte, vite, tslib and other devDependencies
32
48
 
33
49
  # 1.0.52
34
- * Bump @sveltejs/kit, svelte, vite, vitest, pg, adapter-node, google-auth-library, eslint, sass, @typescript*, typescript, prettier, eslint-config-prettier, prettier-plugin-svelte, svelte-check
50
+
51
+ - Bump @sveltejs/kit, svelte, vite, vitest, pg, adapter-node, google-auth-library, eslint, sass, @typescript\*, typescript, prettier, eslint-config-prettier, prettier-plugin-svelte, svelte-check
35
52
 
36
53
  # 1.0.50
37
- * Bump @sveltejs/kit, vite, @typescript*
54
+
55
+ - Bump @sveltejs/kit, vite, @typescript\*
38
56
 
39
57
  # 1.0.50
40
- * Bump @sveltejs/kit, sass, vite
58
+
59
+ - Bump @sveltejs/kit, sass, vite
41
60
 
42
61
  # 1.0.49
43
- * Bump @sveltejs/kit, adapter-node, @typescript*, sass, vitest
62
+
63
+ - Bump @sveltejs/kit, adapter-node, @typescript\*, sass, vitest
44
64
 
45
65
  # 1.0.48
46
- * Bump node, npm, @sveltejs/kit, adapter-node, eslint, prettier
66
+
67
+ - Bump node, npm, @sveltejs/kit, adapter-node, eslint, prettier
47
68
 
48
69
  # 1.0.47
49
- * Bump @sveltejs/kit, adapter-node, @types/google.accounts, @typescript*, eslint, sass, typescript, vite, vitest
70
+
71
+ - Bump @sveltejs/kit, adapter-node, @types/google.accounts, @typescript\*, eslint, sass, typescript, vite, vitest
50
72
 
51
73
  # 1.0.46
52
- * Bump @sveltejs/kit, pg, tslib, vitest
74
+
75
+ - Bump @sveltejs/kit, pg, tslib, vitest
53
76
 
54
77
  # 1.0.45
55
- * Bump @sveltejs/kit, adapter-node, svelte-check, @typescript*, eslint, prettier, vitest, @types/jsonwebtoken
78
+
79
+ - Bump @sveltejs/kit, adapter-node, svelte-check, @typescript\*, eslint, prettier, vitest, @types/jsonwebtoken
56
80
 
57
81
  # 1.0.44
58
- * Bump @sveltejs/kit, svelte
82
+
83
+ - Bump @sveltejs/kit, svelte
59
84
 
60
85
  # 1.0.43
61
- * Bump @sveltejs/kit, svelte-check, vitest, @typescript*, prettier
86
+
87
+ - Bump @sveltejs/kit, svelte-check, vitest, @typescript\*, prettier
62
88
 
63
89
  # 1.0.42
64
- * Bump @sveltejs/kit, vite, @typescript*, eslint-config-prettier, @types/google.accounts
90
+
91
+ - Bump @sveltejs/kit, vite, @typescript\*, eslint-config-prettier, @types/google.accounts
65
92
 
66
93
  # 1.0.41
67
- * Bump @sveltejs/kit, vite, jsonwebtoken, svelte-check, sass
94
+
95
+ - Bump @sveltejs/kit, vite, jsonwebtoken, svelte-check, sass
68
96
 
69
97
  # 1.0.39
70
- * Bump Svelte, SvelteKit, adapter-node, vite, svelte-preprocess,sass, svelte-check, typescript, prettier, prettier-plugin-svelte
98
+
99
+ - Bump Svelte, SvelteKit, adapter-node, vite, svelte-preprocess,sass, svelte-check, typescript, prettier, prettier-plugin-svelte
71
100
 
72
101
  # 1.0.38
73
- * Switch from SendInBlue to Sendgrid for email
74
- * Bump SvelteKit, adapter-node, and vite
102
+
103
+ - Switch from SendInBlue to Sendgrid for email
104
+ - Bump SvelteKit, adapter-node, and vite
75
105
 
76
106
  # 1.0.37
77
- * Bump SvelteKit, svelte-check, and a few dev dependencies
107
+
108
+ - Bump SvelteKit, svelte-check, and a few dev dependencies
78
109
 
79
110
  # 1.0.36
80
- * Bump SvelteKit, adapter-node, Bootstrap, prettier
111
+
112
+ - Bump SvelteKit, adapter-node, Bootstrap, prettier
81
113
 
82
114
  # 1.0.35
83
- * Update SvelteKit, vite, Typescript
115
+
116
+ - Update SvelteKit, vite, Typescript
84
117
 
85
118
  # 1.0.34
86
- * Update SvelteKit
119
+
120
+ - Update SvelteKit
87
121
 
88
122
  # 1.0.33
89
- * Update dependencies
123
+
124
+ - Update dependencies
90
125
 
91
126
  # 1.0.32
92
- * Remove window from reference to google.accounts
93
- * Add apple-touch-icon.png
94
- * Update dependencies
95
- * Remove dead code
127
+
128
+ - Remove window from reference to google.accounts
129
+ - Add apple-touch-icon.png
130
+ - Update dependencies
131
+ - Remove dead code
96
132
 
97
133
  # 1.0.31
98
- * Cleanup
99
- * Update SvelteKit
134
+
135
+ - Cleanup
136
+ - Update SvelteKit
100
137
 
101
138
  # 1.0.30
102
- * Fixed bug where opening /login or /register would fail to render Sign in With Google button (onMount in +layout.svelte loads after children's onMount)
103
- * Fix bad path for favicon
104
- * Update dependencies
139
+
140
+ - Fixed bug where opening /login or /register would fail to render Sign in With Google button (onMount in +layout.svelte loads after children's onMount)
141
+ - Fix bad path for favicon
142
+ - Update dependencies
105
143
 
106
144
  # 1.0.29
107
- * Fixed bug in hooks.server.ts - new version of SvelteKit complains about modifying cookie after `const response = await resolve(event)` so moved it up two lines.
108
- * Update dependencies
145
+
146
+ - Fixed bug in hooks.server.ts - new version of SvelteKit complains about modifying cookie after `const response = await resolve(event)` so moved it up two lines.
147
+ - Update dependencies
109
148
 
110
149
  # 1.0.28
111
- * Update dependencies
150
+
151
+ - Update dependencies
112
152
 
113
153
  # 1.0.27
114
- * Update dependencies
154
+
155
+ - Update dependencies
115
156
 
116
157
  # 1.0.26
117
- * On the client, track whether the login session has expired and if so, clear $loginSession
118
- * Update dependencies
158
+
159
+ - On the client, track whether the login session has expired and if so, clear $loginSession
160
+ - Update dependencies
119
161
 
120
162
  # 1.0.25
121
- * Bump dependencies
122
- * Simplify Sign In With Google
163
+
164
+ - Bump dependencies
165
+ - Simplify Sign In With Google
123
166
 
124
167
  # 1.0.24
125
- * Bump dependencies
168
+
169
+ - Bump dependencies
126
170
 
127
171
  # 1.0.23
128
- * Restructured server-side libraries to $lib/server based on https://github.com/sveltejs/kit/pull/6623
129
- * General cleanup
172
+
173
+ - Restructured server-side libraries to $lib/server based on https://github.com/sveltejs/kit/pull/6623
174
+ - General cleanup
130
175
 
131
176
  # 1.0.22
132
- * Move google-auth-library and jsonwebtoken to devDependencies from dependencies and other cleanup to package.json
177
+
178
+ - Move google-auth-library and jsonwebtoken to devDependencies from dependencies and other cleanup to package.json
133
179
 
134
180
  # 1.0.21
135
- * Refactor to use $env/static/private and public, dropping dotenv dependency
136
- * Remove @types/cookie and bootstrap-icons dependencies
181
+
182
+ - Refactor to use $env/static/private and public, dropping dotenv dependency
183
+ - Remove @types/cookie and bootstrap-icons dependencies
137
184
 
138
185
  # 1.0.20
139
- * Bump dependencies
140
- * Add service-worker
141
- * Add dropdown, avatarm and user's first name to navbar once user is logged in
142
- * Refactor user session and update typing
186
+
187
+ - Bump dependencies
188
+ - Add service-worker
189
+ - Add dropdown, avatarm and user's first name to navbar once user is logged in
190
+ - Refactor user session and update typing
143
191
 
144
192
  # 1.0.19
145
- * Added SvelteKit's cookies implementation in RequestEvent
146
- * [Bug] Logout then go to http://localhost/admin gives error on auth.ts:39
193
+
194
+ - Added SvelteKit's cookies implementation in RequestEvent
195
+ - [Bug] Logout then go to http://localhost/admin gives error on auth.ts:39
147
196
 
148
197
  # 1.0.18
149
- * Bump dependencies
198
+
199
+ - Bump dependencies
150
200
 
151
201
  # 1.0.17
152
- * Bump dependencies
202
+
203
+ - Bump dependencies
153
204
 
154
205
  # 1.0.16
155
- * [Bug] Fixed LayoutServerLoad typing
206
+
207
+ - [Bug] Fixed LayoutServerLoad typing
156
208
 
157
209
  # 1.0.15
158
- * [Bug] Replaced use of Action type in +server.ts files (only works for +page.server.ts)
210
+
211
+ - [Bug] Replaced use of Action type in +server.ts files (only works for +page.server.ts)
159
212
 
160
213
  # 1.0.14
161
- * Refactor routing to be folder, not file-based - https://github.com/sveltejs/kit/discussions/5774 (file system router). More info: https://github.com/sveltejs/kit/discussions/5774#discussioncomment-3294867
162
- * Move bootstrap SCSS import to JavaScript in +layout.svelte
163
- * Refactor as session was removed in https://github.com/sveltejs/kit/discussions/5883
214
+
215
+ - Refactor routing to be folder, not file-based - https://github.com/sveltejs/kit/discussions/5774 (file system router). More info: https://github.com/sveltejs/kit/discussions/5774#discussioncomment-3294867
216
+ - Move bootstrap SCSS import to JavaScript in +layout.svelte
217
+ - Refactor as session was removed in https://github.com/sveltejs/kit/discussions/5883
164
218
 
165
219
  # 1.0.13
166
- * Bump dependencies
220
+
221
+ - Bump dependencies
167
222
 
168
223
  # 1.0.12
169
- * Remove unnecessary reference from app.d.ts
170
- * Remove commented lines in svelte.config.js
224
+
225
+ - Remove unnecessary reference from app.d.ts
226
+ - Remove commented lines in svelte.config.js
171
227
 
172
228
  # 1.0.10
173
- * Bump dependencies
174
- * Adjust for changes to SvelteKit
175
- * Improve typings
229
+
230
+ - Bump dependencies
231
+ - Adjust for changes to SvelteKit
232
+ - Improve typings
176
233
 
177
234
  # 1.0.9
178
- * Bump dependencies
179
- * Adjust for changes to SvelteKit with respect to vite
235
+
236
+ - Bump dependencies
237
+ - Adjust for changes to SvelteKit with respect to vite
180
238
 
181
239
  # 1.0.7
182
- * Bump dependencies and verify against latest SvelteKit
183
- * Additional changes for register PostgreSQL function
240
+
241
+ - Bump dependencies and verify against latest SvelteKit
242
+ - Additional changes for register PostgreSQL function
184
243
 
185
244
  # 1.0.5
186
- * Bump dependencies
187
- * [Fix] Flaw in register allowing user to register over top of an existing account
188
- * Additional checks of submitted data
245
+
246
+ - Bump dependencies
247
+ - [Fix] Flaw in register allowing user to register over top of an existing account
248
+ - Additional checks of submitted data
189
249
 
190
250
  # 1.0.4
191
- * Bump dependencies
251
+
252
+ - Bump dependencies
192
253
 
193
254
  # 1.0.4
194
- * [Fix] If you login with a Google account, you cannot Update the Profile (UI is looking for password and confirm password which don't make sense in this context)
195
- * Added Content Security Policy
255
+
256
+ - [Fix] If you login with a Google account, you cannot Update the Profile (UI is looking for password and confirm password which don't make sense in this context)
257
+ - Added Content Security Policy
196
258
 
197
259
  # 1.0.3
198
- * [Fix] user created or updated when password mismatches (@lxy-yz)
199
- * Updated project dependencies
200
- * Replaced Sveltestrap's Toast with native Bootstrap 5 JavaScript to avoid error with @popperjs import (lacks type=module)
201
- * Added declarations for Session and Locals for type safety
260
+
261
+ - [Fix] user created or updated when password mismatches (@lxy-yz)
262
+ - Updated project dependencies
263
+ - Replaced Sveltestrap's Toast with native Bootstrap 5 JavaScript to avoid error with @popperjs import (lacks type=module)
264
+ - Added declarations for Session and Locals for type safety
202
265
 
203
266
  # 1.0.2
204
- * [Fix] Updated endpoints and hooks to conform to SvelteKit's API changes.
205
- * Updated project dependencies
267
+
268
+ - [Fix] Updated endpoints and hooks to conform to SvelteKit's API changes.
269
+ - Updated project dependencies
206
270
 
207
271
  # 1.0.1
208
- * Switched to dotenv vs. VITE_ env values for better security
209
- * Load Sign in with Google via code instead of static template
210
- * Fix logout (didn't work if session expired)
211
- * Fix login button rendering if that's the starting page
272
+
273
+ - Switched to dotenv vs. VITE\_ env values for better security
274
+ - Load Sign in with Google via code instead of static template
275
+ - Fix logout (didn't work if session expired)
276
+ - Fix login button rendering if that's the starting page
212
277
 
213
278
  # Backlog
214
- * [Low] Add password complexity check
215
- * [Low] Add Google reCaptcha 3
279
+
280
+ - [Low] Add password complexity check
281
+ - [Low] Add Google reCaptcha 3
package/README.md CHANGED
@@ -10,6 +10,7 @@ It's a Single Page App (SPA) built with SvelteKit and a PostgreSQL database back
10
10
  The project includes a Content Security Policy (CSP) in svelte.config.js.
11
11
 
12
12
  The website supports two types of authentication:
13
+
13
14
  1. **Local accounts** via username (email) and password
14
15
  - The login form (/src/routes/login/+page.svelte) sends the login info as JSON to endpoint /auth/login
15
16
  - The endpoint passes the JSON to PostgreSQL function authenticate(json) which hashes the password and compares it to the stored hashed password in the users table. The function returns JSON containing a session ID (v4 UUID) and user object (sans password).
@@ -31,6 +32,7 @@ The website supports two types of authentication:
31
32
  The forgot password / password reset functionality uses a JWT and [**SendGrid**](https://www.sendgrid.com) to send the email. You would need to have a **SendGrid** account and set two environmental variables. Email sending is in /src/routes/auth/forgot.ts. This code could easily be replaced by nodemailer or something similar. Note: I have no affliation with **SendGrid** (used their API in another project).
32
33
 
33
34
  ## Prerequisites
35
+
34
36
  - PostgreSQL 14.10 or higher
35
37
  - Node.js 18.19.0 or higher
36
38
  - Google API client
@@ -41,6 +43,7 @@ The forgot password / password reset functionality uses a JWT and [**SendGrid**]
41
43
  Here are the steps:
42
44
 
43
45
  1. Get the project and setup the database
46
+
44
47
  ```bash
45
48
  # Clone the repo to your current directory
46
49
  git clone https://github.com/nstuyvesant/sveltekit-auth-example.git
@@ -58,6 +61,7 @@ psql -d postgres -f db_create.sql
58
61
  3. [Create a free Twilio SendGrid account](https://signup.sendgrid.com) and generate an API Key following [this documentation](https://docs.sendgrid.com/ui/account-and-settings/api-keys) and add a sender as documented [here](https://docs.sendgrid.com/ui/sending-email/senders).
59
62
 
60
63
  4. Create an **.env** file at the top level of the project with the following values (substituting your own id and PostgreSQL username and password):
64
+
61
65
  ```bash
62
66
  DATABASE_URL=postgres://user:password@localhost:5432/auth
63
67
  DOMAIN=http://localhost:3000
@@ -77,10 +81,11 @@ yarn dev -- --open
77
81
  ## Valid logins
78
82
 
79
83
  The db_create.sql script adds three users to the database with obvious roles:
84
+
80
85
  - admin@example.com password admin123
81
86
  - teacher@example.com password teacher123
82
87
  - student@example.com password student123
83
88
 
84
89
  ## My ask of you
85
90
 
86
- Please report any issues [here](https://github.com/nstuyvesant/sveltekit-auth-example/issues). [Pull requests](https://github.com/nstuyvesant/sveltekit-auth-example/pulls) are encouraged especially as SvelteKit is evolving rapidly.
91
+ Please report any issues [here](https://github.com/nstuyvesant/sveltekit-auth-example/issues). [Pull requests](https://github.com/nstuyvesant/sveltekit-auth-example/pulls) are encouraged especially as SvelteKit is evolving rapidly.
package/package.json CHANGED
@@ -1,68 +1,69 @@
1
1
  {
2
- "name": "sveltekit-auth-example",
3
- "description": "SvelteKit Authentication Example",
4
- "version": "2.0.0",
5
- "author": "Nate Stuyvesant",
6
- "license": "https://github.com/nstuyvesant/sveltekit-auth-example/blob/master/LICENSE",
7
- "repository": {
8
- "type": "git",
9
- "url": "https://github.com/nstuyvesant/sveltekit-auth-example.git"
10
- },
11
- "bugs": {
12
- "url": "https://github.com/nstuyvesant/sveltekit-auth-example/issues"
13
- },
14
- "keywords": [
15
- "svelte",
16
- "sveltekit",
17
- "authentication",
18
- "example",
19
- "google",
20
- "postgresql"
21
- ],
22
- "scripts": {
23
- "start": "node build",
24
- "dev": "vite dev",
25
- "build": "vite build",
26
- "package": "svelte-kit package",
27
- "preview": "vite preview",
28
- "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
29
- "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
30
- "lint": "prettier --check . && eslint .",
31
- "format": "prettier --write ."
32
- },
33
- "engines": {
34
- "node": "^18.19.0"
35
- },
36
- "type": "module",
37
- "dependencies": {
38
- "@sendgrid/mail": "^8.1.0",
39
- "pg": "^8.11.3"
40
- },
41
- "devDependencies": {
42
- "@sveltejs/adapter-node": "^2.0.0",
43
- "@sveltejs/kit": "^2.0.0",
44
- "@sveltejs/vite-plugin-svelte": "^3.0.1",
45
- "@types/bootstrap": "5.2.10",
46
- "@types/google.accounts": "^0.0.14",
47
- "@types/jsonwebtoken": "^9.0.5",
48
- "@types/pg": "^8.10.9",
49
- "@typescript-eslint/eslint-plugin": "^6.14.0",
50
- "@typescript-eslint/parser": "^6.14.0",
51
- "bootstrap": "^5.3.2",
52
- "eslint": "^8.56.0",
53
- "eslint-config-prettier": "^9.1.0",
54
- "eslint-plugin-svelte3": "^4.0.0",
55
- "google-auth-library": "^9.4.1",
56
- "jsonwebtoken": "^9.0.2",
57
- "prettier": "^3.1.1",
58
- "prettier-plugin-svelte": "^3.1.2",
59
- "sass": "^1.69.5",
60
- "svelte": "^4.2.8",
61
- "svelte-check": "^3.6.2",
62
- "tslib": "^2.6.2",
63
- "typescript": "^5.3.3",
64
- "vite": "^5.0.10",
65
- "vitest": "^1.0.4"
66
- },
67
- "packageManager": "yarn@4.0.2"
2
+ "name": "sveltekit-auth-example",
3
+ "description": "SvelteKit Authentication Example",
4
+ "version": "2.0.2",
5
+ "author": "Nate Stuyvesant",
6
+ "license": "https://github.com/nstuyvesant/sveltekit-auth-example/blob/master/LICENSE",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/nstuyvesant/sveltekit-auth-example.git"
10
+ },
11
+ "bugs": {
12
+ "url": "https://github.com/nstuyvesant/sveltekit-auth-example/issues"
13
+ },
14
+ "keywords": [
15
+ "svelte",
16
+ "sveltekit",
17
+ "authentication",
18
+ "example",
19
+ "google",
20
+ "postgresql"
21
+ ],
22
+ "scripts": {
23
+ "start": "node build",
24
+ "dev": "vite dev",
25
+ "build": "vite build",
26
+ "package": "svelte-kit package",
27
+ "preview": "vite preview",
28
+ "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
29
+ "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
30
+ "lint": "prettier --check . && eslint .",
31
+ "format": "prettier --write ."
32
+ },
33
+ "engines": {
34
+ "node": "^18.19.0"
35
+ },
36
+ "type": "module",
37
+ "dependencies": {
38
+ "@sendgrid/mail": "^8.1.0",
39
+ "pg": "^8.11.3"
40
+ },
41
+ "devDependencies": {
42
+ "@sveltejs/adapter-node": "^4.0.1",
43
+ "@sveltejs/kit": "^2.5.0",
44
+ "@sveltejs/vite-plugin-svelte": "^3.0.2",
45
+ "@types/bootstrap": "5.2.10",
46
+ "@types/google.accounts": "^0.0.14",
47
+ "@types/jsonwebtoken": "^9.0.5",
48
+ "@types/pg": "^8.11.0",
49
+ "@typescript-eslint/eslint-plugin": "^6.19.1",
50
+ "@typescript-eslint/parser": "^6.19.1",
51
+ "bootstrap": "^5.3.2",
52
+ "eslint": "^8.56.0",
53
+ "eslint-config-prettier": "^9.1.0",
54
+ "eslint-plugin-svelte": "^2.35.1",
55
+ "google-auth-library": "^9.5.0",
56
+ "jsonwebtoken": "^9.0.2",
57
+ "prettier": "^3.2.4",
58
+ "prettier-plugin-svelte": "^3.1.2",
59
+ "sass": "^1.70.0",
60
+ "svelte": "^4.2.9",
61
+ "svelte-check": "^3.6.3",
62
+ "tslib": "^2.6.2",
63
+ "typescript": "^5.3.3",
64
+ "vite": "^5.0.12",
65
+ "vitest": "^1.2.2"
66
+ },
67
+ "packageManager": "yarn@4.0.2",
68
+ "prettier": "./prettier.config.mjs"
68
69
  }
@@ -0,0 +1,15 @@
1
+ export default {
2
+ $schema: 'https://json.schemastore.org/prettierrc',
3
+ useTabs: true,
4
+ semi: false,
5
+ singleQuote: true,
6
+ trailingComma: 'none',
7
+ printWidth: 100,
8
+ plugins: ['prettier-plugin-svelte'],
9
+ overrides: [
10
+ {
11
+ files: '*.svelte',
12
+ options: { parser: 'svelte' }
13
+ }
14
+ ]
15
+ }