Implement user account feature with backend auth, registration, and profile management#45
Draft
Implement user account feature with backend auth, registration, and profile management#45
Conversation
…nd auth, register, account pages Co-authored-by: webmaxru <1560278+webmaxru@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add user account feature implementation
Implement user account feature with backend auth, registration, and profile management
Mar 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The app had no user persistence — auth was purely client-side with admin detection based on email domain (
@github.com). This adds a real user account system: database-backed credentials, registration, session persistence, and a profile page.Backend
002_users.sql—userstable:email UNIQUE,password_hash,name,role CHECK('user','admin'),created_atUsersRepository— full CRUD +findByEmail,validateCredentials,updatePassword; passwords hashed withcrypto.scryptSync+ 16-byte random salt (no new dependency)/api/usersroutes —POST /login,POST /register,GET /,GET /:id,PUT /:id,DELETE /:idadmin@github.com(role: admin) anduser@example.comaccountsFrontend
AuthContext— replaced domain-check withPOST /api/users/login; addscurrentUserstate,localStoragesession persistence, andupdateCurrentUser()for in-place profile updatesRegister.tsx— new registration form with auto-login on successAccount.tsx— authenticated profile page: view details, edit display name (updates context live), sign outNavigation— shows user's name linked to/accountwith admin badgeLogin.tsx— removeddangerouslySetInnerHTMLXSS vector on the?error=query param; API error messages surfaced properlyapiError.ts— sharedextractApiErrorMessage()utility used across Login, Register, AccountTests
27 unit tests for
UsersRepositoryand thehashPassword/verifyPasswordhelpers.Original prompt
Created from VS Code.
📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.