sveltekit-auth-example 1.0.39 → 1.0.41

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.
package/.eslintignore ADDED
@@ -0,0 +1,13 @@
1
+ .DS_Store
2
+ node_modules
3
+ /build
4
+ /.svelte-kit
5
+ /package
6
+ .env
7
+ .env.*
8
+ !.env.example
9
+
10
+ # Ignore files for PNPM, NPM and YARN
11
+ pnpm-lock.yaml
12
+ package-lock.json
13
+ yarn.lock
package/CHANGELOG.md CHANGED
@@ -1,6 +1,9 @@
1
1
  # Backlog
2
2
  * Add password complexity checking on /register and /profile pages (only checks for length currently despite what the pages say)
3
3
 
4
+ # 1.0.41
5
+ * Bump @sveltejs/kit, vite, jsonwebtoken, svelte-check, sass
6
+
4
7
  # 1.0.39
5
8
  * Bump Svelte, SvelteKit, adapter-node, vite, svelte-preprocess,sass, svelte-check, typescript, prettier, prettier-plugin-svelte
6
9
 
package/README.md CHANGED
@@ -1,8 +1,7 @@
1
1
  # SvelteKit Authentication and Authorization Example
2
2
 
3
3
  This is an example of how to register, authenticate, and update users and limit their access to
4
- areas of the website by role (admin, teacher, student). As almost every recent release of SvelteKit introduced breaking changes, this project attempts to
5
- maintain compatibility with the latest release and leverage new APIs.
4
+ areas of the website by role (admin, teacher, student). It includes profile management and password resets via SendGrid.
6
5
 
7
6
  It's a Single Page App (SPA) built with SvelteKit and a PostgreSQL database back-end. Code is TypeScript and the website is styled using Bootstrap. PostgreSQL functions handle password hashing and UUID generation for the session ID. Unlike most authentication examples, this SPA does not use callbacks that redirect back to the site (causing the website to be reloaded with a visual flash).
8
7
 
@@ -31,8 +30,8 @@ The forgot password / password reset functionality uses a JWT and [**SendGrid**]
31
30
 
32
31
  ## Prerequisites
33
32
  - PostgreSQL 14.5 or higher
34
- - Node.js 18.11.0 or higher
35
- - npm 9.1.1 or higher
33
+ - Node.js 18.12.1 or higher
34
+ - npm 9.2.0 or higher
36
35
  - Google API client
37
36
  - Twilio SendGrid account (only used for emailing password reset link - the sample can run without it but forgot password will not work)
38
37
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sveltekit-auth-example",
3
3
  "description": "SvelteKit Authentication Example",
4
- "version": "1.0.39",
4
+ "version": "1.0.41",
5
5
  "private": false,
6
6
  "author": "Nate Stuyvesant",
7
7
  "license": "https://github.com/nstuyvesant/sveltekit-auth-example/blob/master/LICENSE",
@@ -32,7 +32,7 @@
32
32
  "format": "prettier --write ."
33
33
  },
34
34
  "engines": {
35
- "node": ">=18.11.0",
35
+ "node": ">=18.12.1",
36
36
  "npm": "^9.2.0"
37
37
  },
38
38
  "type": "module",
@@ -41,28 +41,28 @@
41
41
  "pg": "^8.8.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@sveltejs/adapter-node": "latest",
45
- "@sveltejs/kit": "latest",
44
+ "@sveltejs/adapter-node": "^1.0.0",
45
+ "@sveltejs/kit": "^1.0.1",
46
46
  "@types/bootstrap": "5.2.6",
47
47
  "@types/google.accounts": "0.0.4",
48
- "@types/jsonwebtoken": "^8.5.9",
49
- "@types/pg": "^8.6.5",
50
- "@typescript-eslint/eslint-plugin": "^5.46.0",
51
- "@typescript-eslint/parser": "^5.46.0",
48
+ "@types/jsonwebtoken": "^9.0.0",
49
+ "@types/pg": "^8.6.6",
50
+ "@typescript-eslint/eslint-plugin": "^5.47.1",
51
+ "@typescript-eslint/parser": "^5.47.1",
52
52
  "bootstrap": "^5.2.3",
53
- "eslint": "^8.29.0",
53
+ "eslint": "^8.31.0",
54
54
  "eslint-config-prettier": "^8.5.0",
55
55
  "eslint-plugin-svelte3": "^4.0.0",
56
56
  "google-auth-library": "^8.7.0",
57
- "jsonwebtoken": "^8.5.1",
57
+ "jsonwebtoken": "^9.0.0",
58
58
  "prettier": "^2.8.1",
59
59
  "prettier-plugin-svelte": "^2.9.0",
60
- "sass": "^1.56.2",
61
- "svelte": "^3.54.0",
62
- "svelte-check": "^2.10.2",
63
- "svelte-preprocess": "^5.0.0",
60
+ "sass": "^1.57.1",
61
+ "svelte": "^3.55.0",
62
+ "svelte-check": "^3.0.1",
64
63
  "tslib": "^2.4.1",
65
64
  "typescript": "^4.9.4",
66
- "vite": "^4.0.0"
65
+ "vite": "^4.0.3",
66
+ "vitest": "^0.26.3"
67
67
  }
68
68
  }
package/src/app.d.ts CHANGED
@@ -1,8 +1,5 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
2
 
3
- /// <reference types="bootstrap" />
4
- /// <reference types="google.accounts" />
5
-
6
3
  // See https://kit.svelte.dev/docs/types#app
7
4
  // for information about these interfaces
8
5
  // and what to do when importing types
@@ -55,9 +52,3 @@ interface UserSession {
55
52
  id: string,
56
53
  user: User
57
54
  }
58
-
59
- interface Window {
60
- google?: any
61
- grecaptcha: any
62
- bootstrap: Bootstrap
63
- }
@@ -2,7 +2,6 @@
2
2
  import { onMount } from 'svelte'
3
3
  import type { LayoutServerData } from './$types'
4
4
  import { goto, beforeNavigate } from '$app/navigation'
5
- import { page } from '$app/stores'
6
5
  import { loginSession, toast } from '../stores'
7
6
  import { initializeGoogleAccounts } from '$lib/google'
8
7
 
@@ -1,7 +1,6 @@
1
1
  <script lang="ts">
2
2
  import { onMount } from 'svelte'
3
3
  import { goto } from '$app/navigation'
4
- import { page } from '$app/stores'
5
4
  import { loginSession } from '../../stores'
6
5
  import { focusOnFirstError } from '$lib/focus'
7
6
  import { initializeGoogleAccounts, renderGoogleButton } from '$lib/google'
package/svelte.config.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import adapter from '@sveltejs/adapter-node'
2
- import preprocess from 'svelte-preprocess'
2
+ import { vitePreprocess } from '@sveltejs/kit/vite';
3
3
 
4
4
  const production = process.env.NODE_ENV === 'production'
5
5
 
@@ -15,7 +15,7 @@ if (!production) baseCsp.push('ws://localhost:3000')
15
15
 
16
16
  /** @type {import('@sveltejs/kit').Config} */
17
17
  const config = {
18
- preprocess: preprocess(),
18
+ preprocess: vitePreprocess(),
19
19
 
20
20
  kit: {
21
21
  adapter: adapter({
package/.env-sample DELETED
@@ -1,6 +0,0 @@
1
- DATABASE_URL=postgres://REPLACE_WITH_USER:REPLACE_WITH_PASSWORD@localhost:5432/auth
2
- DOMAIN=http://localhost:3000
3
- JWT_SECRET=replace_with_your_own
4
- SENDGRID_KEY=replace_with_your_own
5
- SENDGRID_SENDER=replace_with_your_own
6
- PUBLIC_GOOGLE_CLIENT_ID=REPLACE_WITH_YOUR_OWN