Spaces:
Runtime error
Runtime error
Commit
·
a7bb070
1
Parent(s):
0c38d68
Update TechdocsAPI/backend/services/auth/ops.py
Browse files
TechdocsAPI/backend/services/auth/ops.py
CHANGED
|
@@ -58,7 +58,7 @@ async def ops_signup(bgtasks: BackgroundTasks, response_result: GeneralResponse,
|
|
| 58 |
# bgtasks.add_task(app.state.mail_client.send_message, message=message, template_name="email_verification.html")
|
| 59 |
# await app.state.mail_client.send_message(message=message, template_name="email_verification.html")
|
| 60 |
|
| 61 |
-
DBQueries.insert_to_database('auth', (data.username, Auth.get_password_hash(data.password),
|
| 62 |
['username', 'password', 'email', 'is_verified'])
|
| 63 |
|
| 64 |
|
|
@@ -93,8 +93,8 @@ def ops_login(data:LoginCreds):
|
|
| 93 |
# password is incorrect
|
| 94 |
raise InvalidCredentialsException(response_result)
|
| 95 |
|
| 96 |
-
|
| 97 |
-
|
| 98 |
|
| 99 |
# password is correct
|
| 100 |
return TokenSchema(access_token=Auth.create_access_token(data.username),
|
|
|
|
| 58 |
# bgtasks.add_task(app.state.mail_client.send_message, message=message, template_name="email_verification.html")
|
| 59 |
# await app.state.mail_client.send_message(message=message, template_name="email_verification.html")
|
| 60 |
|
| 61 |
+
DBQueries.insert_to_database('auth', (data.username, Auth.get_password_hash(data.password), "", 0),
|
| 62 |
['username', 'password', 'email', 'is_verified'])
|
| 63 |
|
| 64 |
|
|
|
|
| 93 |
# password is incorrect
|
| 94 |
raise InvalidCredentialsException(response_result)
|
| 95 |
|
| 96 |
+
if not user[2]:
|
| 97 |
+
raise EmailNotVerifiedException()
|
| 98 |
|
| 99 |
# password is correct
|
| 100 |
return TokenSchema(access_token=Auth.create_access_token(data.username),
|