Skip to content

Add user registration endpoint with validation and JWT authentication#17

Open
Archiljain wants to merge 2 commits into
ARGS-PYH:mainfrom
Archiljain:User-api-endpoint/Archiljain
Open

Add user registration endpoint with validation and JWT authentication#17
Archiljain wants to merge 2 commits into
ARGS-PYH:mainfrom
Archiljain:User-api-endpoint/Archiljain

Conversation

@Archiljain
Copy link
Copy Markdown

@Archiljain Archiljain commented Jul 16, 2025

  • Implemented /api/auth/register route
  • Validates input fields, email format, password strength
  • Handles duplicate emails/usernames
  • Returns access token using Flask-JWT-Extended

@Archiljain Archiljain mentioned this pull request Jul 16, 2025
6 tasks
Comment thread backend/models/transaction.py Outdated
@@ -0,0 +1,20 @@
from backend.database import db
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.

@Archiljain This is out of scope for this PR

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

done

Comment thread backend/models/user.py Outdated
transactions = db.relationship('Transaction', backref='user', lazy=True, cascade='all, delete-orphan')
categories = db.relationship('Category', backref='user', lazy=True, cascade='all, delete-orphan')
budgets = db.relationship('Budget', backref='user', lazy=True, cascade='all, delete-orphan')
# categories = db.relationship('Category', backref='user', lazy=True, cascade='all, delete-orphan')
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.

@Archiljain This change is also out of scope for this PR

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

done

Comment thread run.py Outdated
config_name = os.environ.get('FLASK_ENV') or 'default'
app = create_app(config[config_name])
app.run(host='0.0.0.0', port=4000, debug=True)
app.run(host='0.0.0.0', port=7000, debug=True)
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.

@Archiljain Port configuration changes is out of scope.. you can switch port on your local via .env file. please see the readme file.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

done

Comment thread backend/routes/auth.py Outdated
from flask_jwt_extended import create_access_token, jwt_required, get_jwt_identity
from backend.models.user import User
from backend.database import db
from werkzeug.security import generate_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.

@Archiljain Unused import. The user model has this module imported already

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

done

Comment thread backend/routes/auth.py Outdated
user.set_password(password)

# hashing the password

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.

The spaces should be cleanup

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

done

@Archiljain Archiljain requested a review from olaysco July 17, 2025 06:49
@Archiljain
Copy link
Copy Markdown
Author

I have made the changes which are requested. Let me know if anything else is needed.

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