Gregniuki commited on
Commit
e8e4f8b
·
1 Parent(s): bba6d51

Update auth.py

Browse files
Files changed (1) hide show
  1. auth.py +3 -5
auth.py CHANGED
@@ -38,8 +38,7 @@ class AuthViews:
38
  db.add(user_in_db)
39
  db.commit()
40
  db.refresh(user_in_db)
41
-
42
- return user_in_db
43
 
44
  def verify_email(self, verification_token: str, db: Session = Depends(get_db)):
45
  # Verify the email using the token (implement email.verify_token)
@@ -58,7 +57,7 @@ class AuthViews:
58
  # Mark the email as verified
59
  user.is_verified = True
60
  db.commit()
61
- return {"message": "Email verification successful"}
62
 
63
 
64
  def login(self, form_data: OAuth2PasswordRequestForm = Depends()):
@@ -77,8 +76,7 @@ class AuthViews:
77
  self.SECRET_KEY,
78
  algorithm=self.ALGORITHM,
79
  )
80
-
81
- return {"access_token": access_token, "token_type": "bearer"}
82
 
83
 
84
  # Import User model and database functions
 
38
  db.add(user_in_db)
39
  db.commit()
40
  db.refresh(user_in_db)
41
+ return user_in_db
 
42
 
43
  def verify_email(self, verification_token: str, db: Session = Depends(get_db)):
44
  # Verify the email using the token (implement email.verify_token)
 
57
  # Mark the email as verified
58
  user.is_verified = True
59
  db.commit()
60
+ return {"message": "Email verification successful"}
61
 
62
 
63
  def login(self, form_data: OAuth2PasswordRequestForm = Depends()):
 
76
  self.SECRET_KEY,
77
  algorithm=self.ALGORITHM,
78
  )
79
+ return {"access_token": access_token, "token_type": "bearer"}
 
80
 
81
 
82
  # Import User model and database functions