Enable working login/registration flow and enrich CoreFit homepage UI - #2
Merged
Merged
Conversation
Copilot created this pull request from a session on behalf of
JacinthaJanice
July 28, 2026 15:36
View session
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Collaborator
|
is it |
There was a problem hiding this comment.
Pull request overview
This pull request aligns the CoreFit frontend authentication flow with a Node/Express backend by adding health/auth endpoints, and upgrades the post-login homepage UI to show a more informative, session-driven overview.
Changes:
- Added
GET /api/test,POST /api/register, andPOST /api/loginendpoints inserver.js, including email normalization and bcrypt password hashing. - Updated registration success redirect behavior and expanded homepage layouts with hero/overview/feature sections.
- Populated new homepage “quick overview” cards from
sessionStorage(goal/weight/program).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
server.js |
Adds CORS + new health/auth endpoints and user persistence to Excel. |
registration.html |
Tweaks registration UX (login link + redirect to home.html). |
index.html |
Expands homepage UI and adds session-driven overview cards. |
home.html |
Mirrors homepage UI upgrades and session-driven overview cards. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
9
to
11
| const app = express(); | ||
| app.use(cors()); | ||
| app.use(bodyParser.json()); |
Comment on lines
+136
to
+140
| const storedHash = String(getField(user, ["passwordHash", "PasswordHash", "password", "Password"])); | ||
| const isValidPassword = storedHash ? await bcrypt.compare(password, storedHash) : false; | ||
| if (!isValidPassword) { | ||
| return res.status(401).json({ error: "Invalid email or password" }); | ||
| } |
Comment on lines
279
to
283
| @@ -207,6 +282,9 @@ <h2>Welcome to CoreFit!</h2> | |||
| <p><i class="fas fa-dumbbell"></i> Goal: ${goal}</p> | |||
| <p><i class="fas fa-weight"></i> Weight: ${weight} kg</p> | |||
Comment on lines
279
to
283
| @@ -207,6 +282,9 @@ <h2>Welcome to CoreFit!</h2> | |||
| <p><i class="fas fa-dumbbell"></i> Goal: ${goal}</p> | |||
| <p><i class="fas fa-weight"></i> Weight: ${weight} kg</p> | |||
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.
Login and registration were wired to missing/incompatible backend endpoints, so auth flows could not complete. The homepage also lacked meaningful content, making the post-login experience feel empty.
Auth API alignment (server.js)
GET /api/testhealth endpoint used by existing frontend checks.POST /api/registerwith required-field validation, duplicate-email prevention, and password hashing (bcryptjs).POST /api/loginwith credential validation and normalized user payload for session storage.Registration flow fixes (registration.html)
home.htmland added direct login path for existing users.Homepage UX upgrade (home.html, index.html)
sessionStorage(goal,weight,program) to make the landing screen immediately informative.