Skip to content

Conversation

@Amrit1604
Copy link

This PR fixes the security issue where users could access protected pages and functionality without logging in. It implements server-side protections and completes the login/signup/profile/upload flows so pages and APIs require a valid session.

What I changed

Enforced server-side authentication:
Protected pages (dashboard, upload, notes, todolist, profile, edit-profile, etc.) now redirect to the login page when the user is not authenticated.
Implemented server-side auth endpoints:
/api/register, /api/login, /api/logout, /api/user (GET/PUT), /api/change-password
Sessions use Flask server-side session handling.
Made frontend use the API:
login/signup/profile/upload now POST to the backend and use session cookies.
Served the frontend from Flask:
Backend now serves static frontend files so frontend and backend share the same origin (cookies work reliably).
Added secure upload endpoint:
/api/upload saves files in a per-user upload folder, validates size and extensions.
Navbar & UX improvements:
Navbar shows logged-in user name, profile dropdown (View/Edit/Change password/Logout).
Centralized client auth helper (scripts/auth.js) and consistent client behavior.
Hardening & usability:
Server now stores salted password hashes; legacy client-hashes are upgraded on login.
MAX_CONTENT_LENGTH and allowed upload types set.
Repo housekeeping:
.gitignore updated for backend/.venv, uploads, archive
Comments were removed project-wide and a backup of originals was saved to archive/comments-backup/
Created branch feat/server-auth-upload

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Nov 15, 2025

Skipped: This PR changes more files than the configured file change limit: (1059 files found, 100 file limit)

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thanks for submitting your first pull request to the Open Source Society project — we really appreciate your contribution! Our maintainers will review your PR soon. In the meantime, make sure you've followed the contribution checklist and linked any relevant issues. Welcome aboard, and keep contributing! 💚

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.

1 participant