Skip to content

Chat - #9

Open
TrendySloth1001 wants to merge 11 commits into
extended-charfrom
chat
Open

Chat#9
TrendySloth1001 wants to merge 11 commits into
extended-charfrom
chat

Conversation

@TrendySloth1001

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings January 6, 2026 06:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 implements comprehensive authentication and user management features for the homeWork platform, adding Google OAuth integration, JWT-based authentication, user signup flows, and supporting infrastructure.

Key Changes:

  • Google OAuth 2.0 authentication with Passport.js and JWT token management
  • Teacher and student signup workflows with role-based access control
  • Legal document management system for privacy policies, terms of service, and help content
  • Conversation service enhancements with thought tags for AI responses
  • Database schema expansion with User, Teacher, Student, and related models

Reviewed changes

Copilot reviewed 30 out of 31 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/shared/lib/passport.ts Passport.js configuration for Google OAuth authentication
src/features/auth/auth.service.ts Core authentication business logic including JWT generation and user management
src/features/auth/auth.controller.ts HTTP handlers for OAuth callbacks and profile endpoints
src/features/auth/auth.routes.ts Authentication route definitions with rate limiting
src/features/auth/middleware/auth.middleware.ts JWT verification and role-based access control middleware
src/features/signup/signup.*.ts Teacher and student profile completion after OAuth
src/features/legal/legal.*.ts Legal document CRUD operations for compliance content
src/shared/config/index.ts Added auth configuration and changed default port to 3001
src/shared/lib/errors.ts New error classes and asyncHandler utility
src/features/ai/ai.service.ts Added thought tags generation for AI responses
src/features/ai/conversation.service.ts Updated to support thought tags and userId field
src/server.ts Added CORS, passport initialization, and new route handlers
prisma/schema.prisma New User, Teacher, Student models with visibility controls
package.json Auth-related dependencies (passport, JWT, cors, rate-limit, firebase)
public/*.html Frontend test pages for auth and signup flows

Comment thread public/signup.html Outdated

// Pre-fill name if in URL
const name = urlParams.get('name');
const email = urlParams.get('email');

Copilot AI Jan 6, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused variable email.

Suggested change
const email = urlParams.get('email');

Copilot uses AI. Check for mistakes.
Comment thread public/index.html Outdated
}

function displayUserProfile(data) {
const { user, profile } = data;

Copilot AI Jan 6, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused variable profile.

Suggested change
const { user, profile } = data;
const { user } = data;

Copilot uses AI. Check for mistakes.
Comment thread src/features/auth/auth.controller.ts Outdated
getUserProfileService,
deactivateUserService,
} from './auth.service';
import { AuthenticatedRequest, GoogleProfile, JWTPayload } from './auth.types';

Copilot AI Jan 6, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import AuthenticatedRequest.

Copilot uses AI. Check for mistakes.
import { UserRole } from '@prisma/client';
import { verifyTokenService } from '../auth.service';
import { UnauthorizedError } from '../../../shared/lib/errors';
import { AuthenticatedRequest, JWTPayload } from '../auth.types';

Copilot AI Jan 6, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import AuthenticatedRequest.

Copilot uses AI. Check for mistakes.
Comment thread src/features/signup/signup.service.ts Outdated
});

// Create teacher profile
const teacher = await prisma.teacher.create({

Copilot AI Jan 6, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused variable teacher.

Suggested change
const teacher = await prisma.teacher.create({
await prisma.teacher.create({

Copilot uses AI. Check for mistakes.
Comment thread src/features/signup/signup.service.ts Outdated
});

// Create student profile
const student = await prisma.student.create({

Copilot AI Jan 6, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused variable student.

Suggested change
const student = await prisma.student.create({
await prisma.student.create({

Copilot uses AI. Check for mistakes.
TrendySloth1001 and others added 4 commits January 6, 2026 11:52
we4rw4

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…used code

Co-authored-by: TrendySloth1001 <133957092+TrendySloth1001@users.noreply.github.com>
Co-authored-by: TrendySloth1001 <133957092+TrendySloth1001@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants