Skip to content

Added Login and SignUp pages - #3

Open
mehadave wants to merge 2 commits into
mainfrom
meha_test
Open

Added Login and SignUp pages#3
mehadave wants to merge 2 commits into
mainfrom
meha_test

Conversation

@mehadave

@mehadave mehadave commented Feb 2, 2026

Copy link
Copy Markdown
Owner
  • Added Login and SignUp pages
  • Added LogOut button on Home page
  • Checked backend and frontend connectivity
  • Set up database

Comment thread backend/app/__init__.py
jwt.init_app(app)

# Ensure models are imported before create_all
from . import models # noqa: F401

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

what's oqa: F401?

Comment thread backend/app/__init__.py
with app.app_context():
db.create_all()

# Register API routes (Blueprint)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Blueprint?

Comment thread backend/app/models.py
@@ -1,5 +1,19 @@
from werkzeug.security import generate_password_hash, check_password_hash

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Comment thread backend/app/routes.py Outdated
Comment on lines +8 to +11
@api.get("/api/health")
def health():
return jsonify({"status": "backend running"})
return jsonify(status="backend running")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Get rid if this


@api.post("/api/auth/signup")
def signup():
data = request.get_json(silent=True) or {}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why do we need silent=True? Can't we give 401 bad request?


@api.post("/api/auth/login")
def login():
data = request.get_json(silent=True) or {}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why do we need to fail it silently? Send Bad Request to FE

return jsonify(token=token), 200


@api.get("/api/me")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What is this api doing?

Comment on lines +56 to +58
def me():
email = get_jwt_identity()
return jsonify(email=email), 200

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What's the use?

@@ -0,0 +1,135 @@
import * as React from 'react';

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Don't need this import. Remove

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.

2 participants