-
Notifications
You must be signed in to change notification settings - Fork 0
Setup tweaks #18
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
Setup tweaks #18
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the authentication and authorization setup by migrating from NextAuth to better-auth, switching the database provider from PostgreSQL to SQLite, and reorganizing the safe action client implementation with improved type safety.
- Migrated authentication system from NextAuth to better-auth
- Restructured database schema with separate auth tables and user data tables
- Implemented role-based authorization with admin and protected action clients
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/lib/types.ts | Defines role types used across authentication and authorization |
| src/lib/safe-action.ts | Replaces ActionClient.ts with improved safe action client implementation using better-auth |
| src/lib/auth.ts | Updates auth configuration to use better-auth with SQLite adapter |
| src/lib/auth-client.ts | Updates client configuration to use environment variable for base URL |
| src/lib/ActionClient.ts | Removed file - replaced by safe-action.ts |
| src/db/schema.ts | Refactors schema to define user_data table with foreign key to auth users table |
| src/db/index.ts | Updates database client to include auth-schema in the schema configuration |
| src/db/auth-schema.ts | Adds better-auth required tables (users, sessions, accounts, verifications) |
| src/app/admin/courses/create/page.tsx | Adds placeholder page component for course creation |
| package.json | Adds Drizzle Kit database management scripts |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 16 out of 17 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Satisfies