Spaces:
Runtime error
Runtime error
Commit
·
2af299a
1
Parent(s):
940bb6c
Update TechdocsAPI/backend/services/auth/ops.py
Browse files
TechdocsAPI/backend/services/auth/ops.py
CHANGED
@@ -49,15 +49,15 @@ async def ops_signup(bgtasks: BackgroundTasks, response_result: GeneralResponse,
|
|
49 |
)
|
50 |
|
51 |
# bgtasks.add_task(app.state.mail_client.send_message, message=message, template_name="email_verification.html")
|
52 |
-
await app.state.mail_client.send_message(message=message, template_name="email_verification.html")
|
53 |
|
54 |
-
DBQueries.insert_to_database('auth', (data.username, Auth.get_password_hash(data.password),
|
55 |
['username', 'password', 'email', 'is_verified'])
|
56 |
|
57 |
|
58 |
|
59 |
response_result.status = 'success'
|
60 |
-
response_result.message = [f'Activate your account by clicking on the link sent to {data.email}.\nMake sure to check your spam folder.']
|
61 |
|
62 |
def ops_login(data:LoginCreds):
|
63 |
"""Wrapper method to handle login process.
|
@@ -86,8 +86,8 @@ def ops_login(data:LoginCreds):
|
|
86 |
# password is incorrect
|
87 |
raise InvalidCredentialsException(response_result)
|
88 |
|
89 |
-
if not user[2]:
|
90 |
-
|
91 |
|
92 |
# password is correct
|
93 |
return TokenSchema(access_token=Auth.create_access_token(data.username),
|
|
|
49 |
)
|
50 |
|
51 |
# bgtasks.add_task(app.state.mail_client.send_message, message=message, template_name="email_verification.html")
|
52 |
+
# await app.state.mail_client.send_message(message=message, template_name="email_verification.html")
|
53 |
|
54 |
+
DBQueries.insert_to_database('auth', (data.username, Auth.get_password_hash(data.password), data.email, 1),
|
55 |
['username', 'password', 'email', 'is_verified'])
|
56 |
|
57 |
|
58 |
|
59 |
response_result.status = 'success'
|
60 |
+
# response_result.message = [f'Activate your account by clicking on the link sent to {data.email}.\nMake sure to check your spam folder.']
|
61 |
|
62 |
def ops_login(data:LoginCreds):
|
63 |
"""Wrapper method to handle login process.
|
|
|
86 |
# password is incorrect
|
87 |
raise InvalidCredentialsException(response_result)
|
88 |
|
89 |
+
# if not user[2]:
|
90 |
+
# raise EmailNotVerifiedException()
|
91 |
|
92 |
# password is correct
|
93 |
return TokenSchema(access_token=Auth.create_access_token(data.username),
|