Spaces:
Runtime error
Runtime error
Commit
·
d7d7e94
1
Parent(s):
9b66934
update congifenv
Browse files
TechdocsAPI/backend/services/auth/ops.py
CHANGED
@@ -46,7 +46,7 @@ async def ops_signup(bgtasks: BackgroundTasks, response_result: GeneralResponse,
|
|
46 |
subtype=MessageType.html
|
47 |
)
|
48 |
|
49 |
-
await app.state.mail_client.send_message(message=message, template_name="email_verification.html")
|
50 |
|
51 |
# status = post_request(url=config.MAIL_SERVER_URL, data=details, headers=None)
|
52 |
# if status != 200:
|
@@ -54,7 +54,7 @@ async def ops_signup(bgtasks: BackgroundTasks, response_result: GeneralResponse,
|
|
54 |
|
55 |
|
56 |
|
57 |
-
DBQueries.insert_to_database('auth', (data.username, Auth.get_password_hash(data.password),
|
58 |
['username', 'password', 'email', 'is_verified'])
|
59 |
|
60 |
|
@@ -89,8 +89,8 @@ def ops_login(data:LoginCreds):
|
|
89 |
# password is incorrect
|
90 |
raise InvalidCredentialsException(response_result)
|
91 |
|
92 |
-
if not user[2]:
|
93 |
-
|
94 |
|
95 |
# password is correct
|
96 |
return TokenSchema(access_token=Auth.create_access_token(data.username),
|
|
|
46 |
subtype=MessageType.html
|
47 |
)
|
48 |
|
49 |
+
# await app.state.mail_client.send_message(message=message, template_name="email_verification.html")
|
50 |
|
51 |
# status = post_request(url=config.MAIL_SERVER_URL, data=details, headers=None)
|
52 |
# if status != 200:
|
|
|
54 |
|
55 |
|
56 |
|
57 |
+
DBQueries.insert_to_database('auth', (data.username, Auth.get_password_hash(data.password), data.email, 1),
|
58 |
['username', 'password', 'email', 'is_verified'])
|
59 |
|
60 |
|
|
|
89 |
# password is incorrect
|
90 |
raise InvalidCredentialsException(response_result)
|
91 |
|
92 |
+
# if not user[2]:
|
93 |
+
# raise EmailNotVerifiedException()
|
94 |
|
95 |
# password is correct
|
96 |
return TokenSchema(access_token=Auth.create_access_token(data.username),
|