Skip to content

Commit

Permalink
Merge pull request #227 from Build-Squad/fix-email-sign-up
Browse files Browse the repository at this point in the history
Fix email signup and update JWT token
  • Loading branch information
varsha1305nav authored Mar 5, 2024
2 parents c18fa58 + 3e606ac commit 0f781e2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/api/marketplace/accounts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1162,8 +1162,6 @@ def post(self, request):
# If user is logging in for the first time, set email_verified_at to current time
if user.email_verified_at is None:
user.email_verified_at = datetime.datetime.now()
user.login_method = "email"
user.save()
jwt_operations = JWTOperations()
user_id = str(user.id)
payload = {
Expand All @@ -1174,6 +1172,9 @@ def post(self, request):
}
response = Response() # Create a new Response instance
token = jwt_operations.generateToken(payload)
user.jwt = token
user.login_method = "email"
user.save()
response.set_cookie(
"jwt",
token,
Expand Down

0 comments on commit 0f781e2

Please sign in to comment.