Commit Graph
1377 Commits
Author SHA1 Message Date
Abdulmuizz Hamzat c45f3443f8 refactor: remove Supabase dependency and related user validation logic (#610) 2025-12-07 15:41:42 +01:00
Rotimi Best 4b52906445 feat: enhance API route naming conventions and structure
- Added comprehensive guidelines for API route naming and structure in `ROUTE_NAMING_BEST_PRACTICES.md`.
- Updated `ARCHITECHTURE.md` to reference the new best practices document.
- Refactored course-related routes to follow new naming conventions, including changes to endpoint paths and validation schemas.
- Removed the deprecated course clone route and integrated cloning functionality directly into the course routes.
- Adjusted various API methods to ensure consistent usage of HTTP methods and parameter structures across the application.
2025-12-05 17:24:16 +01:00
Adeyemi Adetunji eff364baa4 feat: add Underline Tab component (#608)
* feat: add Underline Tab component

* chore: pr fixes

* chore: add .js extensions
2025-12-05 17:20:55 +01:00
Adeyemi Adetunji c1920e0c02 chore: removed unused folder from repo (#609) 2025-12-05 15:44:37 +01:00
Rotimi Best ac1a05f006 feat: move course analytics request to api 2025-12-05 11:20:12 +01:00
Rotimi Best 97d9e490b0 fix: update API endpoints and course marks page 2025-12-05 11:11:37 +01:00
Rotimi Best ac4fdf1dd3 feat: migrate client-side database calls to secure server-side API endpoints
- Create secure server-side API endpoints for course data, marks, exercises, newsfeeds, submissions, and organization management
- Implement role-based permission checking using checkUserCoursePermissions utility
- Move all client-side Supabase calls to authenticated server endpoints in /api/courses/ and /api/org/
- Add proper authentication and authorization middleware via hooks.server.ts
- Update service functions to use getAccessToken() for API authentication
- Ensure data filtering based on user roles (students only see their own data)
- Maintain backward compatibility with existing component interfaces
2025-12-05 10:48:01 +01:00
Rotimi Best bf614fd782 fix: update profile visibility policies to restrict access to user profiles 2025-12-05 06:07:39 +01:00
Rotimi Best 35b9afdde5 chore: remove public profile visibility policy for enhanced privacy 2025-12-05 05:54:42 +01:00
Adeyemi AdetunjiandRotimi Best ce216b1ade feat: Add Image Cropper to ui & storybook (#607)
* feat: add image cropper

* installation

* chore: add max width for dialogue container

---------

Co-authored-by: Rotimi Best <best@classroomio.com>
2025-12-04 01:51:58 +01:00
Rotimi Best ea93075bd5 fix: update content security policy to allow YouTube and refine source origins 2025-12-04 00:10:15 +01:00
Rotimi Best 964c036252 fix: enhance email verification protection by ensuring DOM manipulation only occurs in the browser 2025-12-04 00:00:48 +01:00
Rotimi Best 25d1a8d710 Security Release v0.2.6: Email Verification Bypass Vulnerabilities Fixed
Critical security fixes addressing email verification bypass vulnerabilities:

Security Issues Fixed:
- Email verification status manipulation through client-side profile updates
- Base64 token forgery allowing arbitrary email verification
- DOM manipulation bypasses of email verification modal

Backend Security Enhancements:
- Secure verification tokens table with cryptographic token generation
- RLS policies preventing direct email verification status changes
- Server-side validation functions with expiration and ownership checks
- Database triggers blocking unauthorized verification status updates
- IP address logging and audit trails for security monitoring

Frontend Security Protections:
- Multi-layered DOM protection preventing UI manipulation bypasses
- Continuous monitoring and re-application of interaction restrictions
- CSS-based backup protection even if JavaScript is disabled
- Mutation observer to protect dynamically added elements
- Enhanced CSP configuration for Senja widget support

API Security Updates:
- Secure token-based verification replacing insecure Base64 method
- Comprehensive error handling with security-focused user messages
- Token validation with signature verification and expiration checks
- Legacy verification method blocking with security warnings
- Enhanced verification email generation with secure tokens

Files Modified:
- Database: New email_verification_tokens table and security functions
- API: Secure verification endpoints with token validation
- Frontend: DOM protection and verification modal enhancements
- CSP: Updated Content Security Policy configuration
- Blog: Security advisory for CVE-2025-65675 disclosure

This release patches critical authentication bypass vulnerabilities and
implements defense-in-depth security measures across the entire platform.

Security researchers and users should upgrade immediately.
2025-12-03 15:33:04 +01:00
Rotimi Best 43e6cd611d chore: auto logout test emails. 2025-12-03 13:48:25 +01:00
Rotimi Best 900f5ec129 fix: critical SVG XSS vulnerability in file uploads
- Add comprehensive file type validation to prevent SVG uploads
- Update upload widgets to restrict file types at input level
- Enhanced HTML sanitization to block SVG tags and data URLs
- Create centralized file validation utilities with shared constants
- Add client-side and server-side protection against malicious uploads

Security Impact:
- Prevents stored XSS attacks through malicious SVG profile uploads
- Blocks execution of JavaScript embedded in SVG files
- Enforces whitelist of safe image formats (JPEG, PNG, GIF, WebP)
- Provides defense-in-depth protection across all upload components

Fixes reported vulnerability in profile image upload functionality.
2025-12-03 11:25:00 +01:00
Rotimi Best fb2ea885e1 chore: update translation 2025-12-03 10:59:08 +01:00
Rotimi Best 4ac242d918 fix: add PostHog domains to CSP connect-src
- Add https://*.i.posthog.com to both enforcement and reportOnly CSP
- Resolves CSP violations blocking PostHog source maps and assets
- Fixes blocked requests to recorder.js.map and surveys.js.map

This ensures PostHog analytics work properly without CSP violations.
2025-12-03 10:28:02 +01:00
Rotimi Best 9fe7691f8d fix: CSP configuration for API and media access
- Add https://api.classroomio.com to connect-src for API calls
- Add https://*.r2.cloudflarestorage.com for Cloudflare R2 storage
- Add media-src directive to allow video/document loading
- Fixes CSP violations blocking video downloads and API requests

Resolves CSP errors preventing presigned URL requests and media playback.
2025-12-03 10:10:08 +01:00
Rotimi Best 07ecfcf967 fix: authorization bypass vulnerabilities in plan-restricted features
- Add plan validation to custom domain saving (Domains.svelte)
- Add plan validation to certificate customization (Design.svelte)
- Add plan validation to document upload (AddDocumentToLesson.svelte)
- Add plan validation to video upload (UploadVideo.svelte)
- Enhance team member function validation (TeamMembers.svelte)

Prevents free users from bypassing UI restrictions via DOM manipulation.
All restricted functions now enforce server-side plan validation.
2025-12-03 10:01:50 +01:00
Rotimi Best 7014757ed5 fix: add PostHog and Umami analytics to CSP
- Added https://eu-assets.i.posthog.com for PostHog scripts
- Added https://eu.i.posthog.com for PostHog API calls
- Added https://umami.hz.oncws.com for Umami analytics
- Maintains XSS protection while enabling analytics
2025-12-03 09:44:31 +01:00
Rotimi Best 7b18c325da fix: cross site scripting with html content 2025-12-03 09:33:53 +01:00
Rotimi Best f2b719cd1b chore: more email validation 2025-12-03 07:31:35 +01:00
Adeyemi AdetunjiandRotimi Best 9a5aee1ee0 feat: setup dashboard analytics api (#604)
* feat: setup dashboard analytics api

* chore: requested pr fixes

* fix: dash analytics server side type

* refactor: update Avatar component usage across the dashboard

- Replaced custom Avatar component with the new @cio/ui/base/avatar implementation for consistency.
- Enhanced avatar rendering with fallback options and improved accessibility.
- Cleaned up unused Avatar component files and related functions.
- Updated various components to utilize the new Avatar structure, ensuring a uniform appearance and behavior across the application.

* chore: remove console.log statements from analytics routes and API calls

- Eliminated console.log statements for orgId and siteName in the dash analytics router and DashStatApi class to clean up the code and improve performance.

---------

Co-authored-by: Rotimi Best <best@classroomio.com>
2025-12-02 15:27:41 +01:00
Rotimi Best c7854efae3 feat: redo settings and all org pages. (#601)
* feat: new components, deploy storybook

* refactor: simplify component field definitions and enhance button loading state

- Removed unnecessary type imports and simplified the FIELDS array definitions across multiple components in Storybook.
- Updated button component to use a loading state instead of isLoading, improving clarity and consistency in props.
- Adjusted button stories to reflect the new loading prop and enhanced the button's loading visual feedback.
- Minor CSS adjustments for better layout and styling consistency.

* chore: add field, card, password components

* feat: improve page component & update AuthUI path

* chore: update bits-ui to version 2.14.4 and all org related UI's

- Updated bits-ui dependency in pnpm-lock.yaml and package.json to version 2.14.4.
- Refactored imports for RoleBasedSecurity and UpgradeBanner components to use the new ui feature directory.
- Removed unused Course components and related files to clean up the codebase.
- Enhanced various components to improve consistency and maintainability.

* chore: move all setting buttons to the top and update auth ui styles

* chore: remove svelte-loading-spinners and replace with @cio/ui/base/spinner

- Removed all instances of svelte-loading-spinners from the project.
- Updated components to use the new Spinner from @cio/ui/base/spinner.
- Cleaned up pnpm-lock.yaml and package.json to reflect the removal of svelte-loading-spinners.
- Added new CSS animations for rocket launch effects in app.css.
- Enhanced email change flow with updated verification messages in translations.

* chore: remove supabase file upload from dashboard and move to r2

* chore: update organization API and UI components

- Added new API methods for organization plan operations and team management.
- Introduced middleware for API key authentication and organization admin checks.
- Refactored organization-related components to utilize the new API structure.
- Updated various UI components to improve consistency and maintainability.
- Enhanced error handling and validation for organization-related actions.
- Removed deprecated services and streamlined the codebase.
2025-12-02 09:54:38 +01:00
Abdulmuizz Hamzat 531516a8f7 feat: remove supabase dependence during course cloning (#605)
* feat: Add .gitignore file and update package.json with pnpm version

feat: Enhance course queries with error handling and new course retrieval

feat: Implement exercise queries for creating and fetching exercises, questions, and options

feat: Create group queries for managing groups and group members

feat: Add lesson queries for creating lessons and fetching sections by course ID

feat: Update seed script to include seeding for users, profiles, accounts, organizations, groups, courses, lessons, exercises, questions, and options

* feat: Enhance course cloning functionality by refining course and lesson data handling

* chore: remove console.log

* feat: update role assignment in cloneCourse function and clean up unused types in database.ts
2025-12-02 09:48:29 +01:00
Rotimi Best 5cc8c47b72 chore: use postcss instead of tailwind vite 2025-11-25 23:18:42 +01:00
Rotimi Best e0e3c8a01e fix: get branch full working 2025-11-25 17:18:15 +00:00
Rotimi Best 8533e83f03 remove unused files 2025-11-25 10:46:10 +01:00
Rotimi Best a3924100dd feat: migrate auth from supabase to better auth (#596)
* feat: add README for @cio/db package and remove existingAccounts.json

* load session, load profile and organization, add create profile hook

* chore: cache session request

The trick was passing all the cookies to the backend. Previously I was only passing the better-auth.session_token and not better-auth.session_data. Read about the difference here https://www.better-auth.com/docs/concepts/cookies#custom-cookies

* feat: login, logout, onboarding, verify email, reset password.

* feat: complete change email and email verification

* feat: standardise how we make rpc calls and create org endpoints

* fix ui errors

* fix: handle potential undefined customerId and standardize avatar URL property

* refactor: standardize custom domain handling and update telegram chat ID references

* chore: add tailwind prefix to @cio/ui

this fixed the media query issues because  @cio/ui classes were overriding this dashboard tailwind build

* chore: clean up org sidebar

* chore: persist mode state

* feat: implement order breadcrumbs

* chore: upgrade to better auth 1.4

* chore: address common auth flow bugs and setup app for others to setup locally.
2025-11-24 01:00:50 +01:00
Rotimi Best 24741644d6 update output css 2025-11-21 12:20:02 +01:00
Adeyemi AdetunjiandRotimi Best cbf6ae7e63 feat: move away from carbon components and TinyMCE (#597)
* feat: remove tinymce & replace org sidebar

* chore: PR Fixes

* chore: move ui font into src dir

* remove files in vite config

* use google font import for loading font

* remove custom font

* more fonts update

* remove font bold

* more removals of font bold

* fix import

* checkpoint

* chore: checkpoint (add course & lms shadcn sidebar)

* minor css improvements and try out font sans

* chore: replace carbon components with shadcn's

* chore: replace carbon components with shadcn _ v3

* chore: ui fixes & storybook update

* feat: UI cleanup

* fix: quick ui fixes

* chore: update pnpm-lock.yaml with new dependencies and versions; fix output.css formatting

* chore: add isloading to button

* feat: add loading state to button stories

* chore: feedback fixes

* fix: feedback fixes

* chore: remove console

* fix: PR comments

* fix: PR comments

---------

Co-authored-by: Rotimi Best <best@classroomio.com>
2025-11-21 12:18:04 +01:00
Rotimi Best 1e966aaf0f fix: redirect to 404 page after user closes welcome modal.
This is because when you close the modal we redirect you to /org/siteName/courses but if you click close before we get your organization siteName the route is just /courses which redirects to a 404.
2025-11-18 19:16:51 +01:00
Rotimi Best cc7868276a fix: use prebuilt carbon all.css without border 2025-11-18 14:40:10 +01:00
Tanushree Ahir f7006aecdb fix: footer navigation overflows on small screens (#599) 2025-11-18 07:03:11 +01:00
Rotimi Best 2145782385 Merge branch 'main' of https://github.com/classroomio/classroomio into feat/release-v2 2025-11-08 20:23:52 +01:00
Rotimi Best ba47b06647 Merge branch 'main' of https://github.com/classroomio/classroomio into feat/release-v2 2025-11-08 20:22:53 +01:00
Rotimi Best b8c15eabe3 chore: remove debug console log from app.svelte
Removed console log for global store in app.svelte.
2025-11-08 20:20:38 +01:00
Rotimi Best 34e5cab733 chore: [FIXED] clean up console logs in layout and pricing components, add context prompt for ClassroomIO
This point I have fixed 2 major issues
1. After signing in with Google auth, join a course and going to the course, when you click the back button in the page nav, it takes you to admin instead of lms

2. When you open a course landing page, click enroll, it redirects to 404 instead of the invite page.
2025-11-08 18:47:53 +01:00
Rotimi Best b3d5f291f0 chore: fix issue of isOrgSite being false after google auth 2025-11-08 18:27:00 +01:00
Rotimi Best aa42eb9c1f chore: reorder layout setup and debug org set after login 2025-11-08 18:22:41 +01:00
Rotimi Best b783940cee fix: keep org store after logout
This fix tackled a bug where if I logged out, go to org landing page, open a course and enrol then it gets redirected to a 404 page because `$currentOrg.siteName` is undefined.
2025-11-08 17:58:03 +01:00
Rotimi Best 93db0c97e8 chore: use hasSession to check if auth token exists 2025-11-08 17:30:22 +01:00
Rotimi Best 0f433cfa93 chore: debug enrollment on lms 2025-11-08 06:11:44 +01:00
Rotimi Best 9e4609dc7f fix: redirect to login if no session on invite page 2025-11-08 05:51:09 +01:00
Rotimi Best 3d64e25b89 chore: debug lms detection on client side 2025-11-08 05:34:17 +01:00
Rotimi Best 7715834566 chore: debug getSubdomain 2025-11-08 05:22:38 +01:00
Rotimi Best 291e233700 chore: enable auto redirect on layout mount
The use case for this is that if a person went from course page to invite page, and isn't authenticated then the user should be redirected to login page with a redirect query param
2025-11-08 05:02:17 +01:00
Rotimi Best 570b809111 chore: debug join course 2025-11-08 04:52:42 +01:00
Rotimi Best f77258ef23 fix: update path to tsconfigs 2025-11-01 20:52:29 +01:00
Rotimi Best 4052a22961 fix: api alias path 2025-11-01 16:26:34 +01:00