Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: migrate auth to Lucia V3 and Drizzle #72

Merged
merged 75 commits into from
Mar 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
ce2abe1
feat: ✨ initial tabs setup
KevinWu098 Feb 22, 2024
05ae0de
style: 🎨 adjust tabs
KevinWu098 Feb 22, 2024
99832c7
style: 🎨 adjust bg and block colors
KevinWu098 Feb 22, 2024
2dd7272
style: 🎨 borders
KevinWu098 Feb 22, 2024
f0f6210
style: 🎨 set days to 5, simplify styles
KevinWu098 Feb 22, 2024
a517f17
style: 🎨 responsiveness
KevinWu098 Feb 22, 2024
a52440a
feat: ✨ add columns prop, based on viewport width
KevinWu098 Feb 22, 2024
bf35132
style: 🎨 use sean's tabs
KevinWu098 Feb 23, 2024
d24200b
chore: 🔧 remove old availability pages
KevinWu098 Feb 23, 2024
bd7e2a4
chore: 🔧 rename v2 to default
KevinWu098 Feb 23, 2024
417e5f7
fix: 🐛 change sample availability date constructor
seancfong Feb 29, 2024
a655294
feat: ✨ setup stores, buttons for saving
KevinWu098 Feb 29, 2024
f5f1bac
fix: 🐛 revert auth changes for easier development
KevinWu098 Feb 29, 2024
80038bd
feat: basic modal component
KevinWu098 Mar 1, 2024
83f628d
feat: ✨ various modal improvements (esc, backdrop, close icon), styling
KevinWu098 Mar 1, 2024
c798b7d
feat: get login result
KevinWu098 Mar 1, 2024
1a9bebc
Merge branch 'main' into kw/59-create-save-flow
KevinWu098 Mar 1, 2024
9566e37
chore: remove unused code
KevinWu098 Mar 6, 2024
cc74f20
fix: set unsaved state to false only on success
KevinWu098 Mar 6, 2024
5803a72
fix: add support for two forms (login, guest)
KevinWu098 Mar 6, 2024
ade0c4f
style: prevent ui shift at smaller screens
KevinWu098 Mar 6, 2024
2832b9a
chore: create placeholder guest schema
KevinWu098 Mar 6, 2024
b3ef0f3
Merge branch 'main' into kw/59-create-save-flow
KevinWu098 Mar 6, 2024
796036f
fix: handle mobile/desktop with window width
KevinWu098 Mar 7, 2024
42f3ec9
style: mobile styling of modal
KevinWu098 Mar 7, 2024
c2be833
style: decrease button padding on mobile
KevinWu098 Mar 7, 2024
cd69e57
rename LoginFlow to LoginModal
KevinWu098 Mar 7, 2024
efa8991
chore: remove testing code, unused imports
KevinWu098 Mar 7, 2024
d9164de
fix: correct guest input binding
KevinWu098 Mar 7, 2024
f04b62d
feat: ✨ correct login, register to match prisma schema
KevinWu098 Mar 8, 2024
cfec577
style: 🎨 make elements more visible w/ bg color
KevinWu098 Mar 8, 2024
7132278
feat: ✨ correct schema and ui to just have username, email, pw
KevinWu098 Mar 8, 2024
751e46e
feat: ✨ rename username to displayName
KevinWu098 Mar 8, 2024
08252b8
feat: ✨ setup database
KevinWu098 Mar 13, 2024
63a580a
chore: 🔧 add dev db to gitignore
KevinWu098 Mar 13, 2024
6a747a9
refactor: rename boolean stores
KevinWu098 Mar 13, 2024
e13bd5b
refactor: rename to auth-modal
KevinWu098 Mar 13, 2024
065f008
refactor: ♻️ add interface, rename for login data
KevinWu098 Mar 13, 2024
3d73d7e
fix: 🐛 update username to displayName in drizzle schema
KevinWu098 Mar 13, 2024
4a5f93b
chore: 🔧 install dependencies, setup drizzle studio
KevinWu098 Mar 13, 2024
47c2535
feat: ✨ update schema
KevinWu098 Mar 13, 2024
d238f85
chore: 🔧 uninstall unused lucia dep
KevinWu098 Mar 13, 2024
a788621
feat: ✨ update lucia to v3
KevinWu098 Mar 13, 2024
2d5c5a8
feat: ✨ migrate login/registration
KevinWu098 Mar 14, 2024
c6fd08d
fix: 🐛 update load function for load
KevinWu098 Mar 14, 2024
fa2844a
fix: 🐛 clear superform warning
KevinWu098 Mar 14, 2024
cad4862
fix: 🐛 disable google auth config
KevinWu098 Mar 14, 2024
998f998
feat: ✨ update logout
KevinWu098 Mar 14, 2024
ffef516
fix: 🐛 call dotenv config
KevinWu098 Mar 14, 2024
1aa234c
chore: 🔧 remove testing code
KevinWu098 Mar 14, 2024
f2c9efb
fix: 🐛 adjust lucia config
KevinWu098 Mar 14, 2024
a85384d
fix: 🐛 correct postgres client
KevinWu098 Mar 14, 2024
559824c
fix: 🐛 correct schema to use text, not uuid type
KevinWu098 Mar 14, 2024
7850bff
chore: 🔧 remove console logs
KevinWu098 Mar 14, 2024
883c7ba
chore: 🔧 remove log files, update config
KevinWu098 Mar 14, 2024
db08c49
feat: ✨ migrate google oauth
KevinWu098 Mar 14, 2024
65b8d0f
chore: 🔧 remove console log
KevinWu098 Mar 14, 2024
05965a3
Merge branch 'main' into kw/69-auth-drizzle
KevinWu098 Mar 14, 2024
e405ed2
chore: 🔧 update deps
KevinWu098 Mar 14, 2024
c9ec959
chore: 🔧 update deps pt2
KevinWu098 Mar 14, 2024
d9183bd
feat: ✨ disable google auth, correct schema
KevinWu098 Mar 14, 2024
e1d8e83
fix: 🐛 disable google in lucia config
KevinWu098 Mar 14, 2024
fc61906
Merge branch 'kw/59-create-save-flow' into kw/69-auth-drizzle
KevinWu098 Mar 26, 2024
900a800
fix: 🐛 correct bugs and errors from #62
KevinWu098 Mar 27, 2024
99eae17
chore: 🔧 extract existingUser function
KevinWu098 Mar 27, 2024
9da697f
chore: 🔧 remove console log
KevinWu098 Mar 27, 2024
a562171
Merge branch 'main' into kw/69-auth-drizzle
KevinWu098 Mar 27, 2024
7f7e869
fix: 🐛 use scrypt over oslo
KevinWu098 Mar 27, 2024
26052f6
chore: 🔧 remove prisma
KevinWu098 Mar 27, 2024
b7f20a9
feat: ✨ update ProfileCard w/ auth buttons and info
KevinWu098 Mar 27, 2024
9ce4c63
feat: ✨ update login ui
KevinWu098 Mar 27, 2024
2a11814
fix: 🐛 cleanup login
KevinWu098 Mar 27, 2024
d6dfad1
feat: ✨ update register ui
KevinWu098 Mar 27, 2024
4d2a711
chore: 🔧 add error into form error message
KevinWu098 Mar 28, 2024
c20b3a8
Merge branch 'main' into kw/69-auth-drizzle
KevinWu098 Mar 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ vite.config.ts.timestamp-*
.sst
cdk.context.json

/prisma/dev.db
# db
src/lib/db/meta
src/lib/db/*.sql
5 changes: 3 additions & 2 deletions drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
// drizzle.config.ts
import * as dotenv from "dotenv";
import type { Config } from "drizzle-kit";

dotenv.config();

const { DATABASE_URL } = process.env;

if (!DATABASE_URL) {
throw new Error(
"DATABASE_URL not found. Please ensure you have the DATABASE_URL variable defined inside of your environment configuration.",
);
}

export default {
schema: "./src/lib/db/schema.ts",
out: "./migrations",
out: "./src/lib/db",
driver: "pg",
dbCredentials: {
connectionString: DATABASE_URL,
Expand Down
2 changes: 1 addition & 1 deletion lint-staged.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
const config = {
"*.?(c|m){js,ts}?(x)": ["eslint --quiet --fix", "prettier --write"],
"*.svelte": ["eslint --quiet --fix", "prettier --write"],
"*.{css,json,md,prisma,yaml,yml}": ["prettier --write"],
"*.{css,json,md,yaml,yml}": ["prettier --write"],
};

module.exports = config;
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"dev": "sst bind vite dev",
"format": "prettier --write .",
"postinstall": "husky install && prisma generate && drizzle-kit generate:pg && svelte-kit sync",
"postinstall": "husky install && drizzle-kit generate:pg && svelte-kit sync",
"lint": "eslint --quiet --fix .",
"migrate": "drizzle-kit push:pg",
"preview": "vite preview",
Expand All @@ -23,12 +23,12 @@
},
"dependencies": {
"@iconify/json": "^2.2.160",
"@lucia-auth/adapter-prisma": "3.0.2",
"@lucia-auth/oauth": "^3.5.3",
"@prisma/client": "5.6.0",
"@lucia-auth/adapter-drizzle": "^1.0.3",
"arctic": "^1.2.1",
"clsx": "^2.1.0",
"drizzle-orm": "0.29.4",
"lucia": "2.7.4",
"lucia": "^3.1.1",
"pg": "^8.11.3",
"postgres": "3.4.3",
"svelty-picker": "^5.2.1",
"tailwind-merge": "^2.2.1",
Expand All @@ -46,6 +46,7 @@
"@tailwindcss/forms": "^0.5.7",
"@types/lint-staged": "13.2.2",
"@types/node": "20.10.0",
"@types/pg": "^8.11.2",
"@typescript-eslint/eslint-plugin": "6.12.0",
"@typescript-eslint/parser": "6.12.0",
"autoprefixer": "^10.4.14",
Expand All @@ -67,10 +68,8 @@
"postcss-load-config": "^4.0.1",
"prettier": "3.1.0",
"prettier-plugin-packagejson": "2.4.6",
"prettier-plugin-prisma": "5.0.0",
"prettier-plugin-svelte": "3.1.2",
"prettier-plugin-tailwindcss": "^0.5.9",
"prisma": "5.6.0",
"sst": "2.36.6",
"svelte": "4.2.7",
"svelte-check": "3.6.2",
Expand Down
Loading
Loading