Skip to content

Commit

Permalink
fix(backend): student jwt generation on login
Browse files Browse the repository at this point in the history
  • Loading branch information
EliotAmn committed Jan 17, 2025
1 parent 36ebbe4 commit f7b55ba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/api/routes/auth_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from flask import request

from app.models.Student import Student
from app.services.student_service import StudentService
from app.tools.jwt_engine import generate_jwt
from app.tools.password_tools import check_password
Expand Down Expand Up @@ -40,7 +41,7 @@ def validate_email_login():
if not check_password(password, student.password_hash):
return {"error": "Invalid email or password"}, 400

token = generate_jwt(student)
token = StudentService.generate_jwt_token(student)
return {"token": token}, 200

@app.route("/api/auth/register", methods=["POST"])
Expand Down

0 comments on commit f7b55ba

Please sign in to comment.