THIS_SITE_URL="https://qa-panel.mermsemr.com"
This commit is contained in:
@@ -20,7 +20,7 @@ class BaseService:
|
||||
|
||||
SEND_EMAIL_FROM = Config.SEND_EMAIL_FROM
|
||||
SEND_EMAIL_PASS = Config.SEND_EMAIL_PASS
|
||||
|
||||
THIS_SITE_URL = Config.THIS_SITE_URL
|
||||
|
||||
@staticmethod
|
||||
def send_resetpass_mail(signup_email, pending_uid, pending_id, firstname, lastname):
|
||||
@@ -39,7 +39,7 @@ class BaseService:
|
||||
{"user": pending_member, 'exp': datetime.datetime.utcnow() + datetime.timedelta(minutes=3330)},
|
||||
BaseService.JWT_SECRET_KEY, algorithm='HS256'
|
||||
)
|
||||
panel_url = "https://qa-panel.mermsemr.com"
|
||||
panel_url = BaseService.THIS_SITE_URL #"https://qa-panel.mermsemr.com"
|
||||
link_url = str(panel_url) + '/accreset/' + jwt_part
|
||||
|
||||
msg_body = f"""
|
||||
|
||||
@@ -16,7 +16,7 @@ from app.api.schemas.login import LoginSchema
|
||||
from app.api.schemas.reset_pass_start import ResetPassStart
|
||||
from app.api.schemas.reset_pass_verify import ResetPassVerify
|
||||
from app.api.schemas.reset_pass_complete import ResetPassComplete
|
||||
|
||||
import json
|
||||
|
||||
import datetime
|
||||
import jwt
|
||||
@@ -75,15 +75,15 @@ class LoginService(BaseService):
|
||||
|
||||
validated_data = LoginService.validate_data(data, ResetPassVerify())
|
||||
reset_token = validated_data.get('reset_token')
|
||||
|
||||
logger.error("GOT HERE 000001 ")
|
||||
data ={}
|
||||
if not reset_token:
|
||||
return jsonify({'message': 'Error - missing reset_token '}), 403
|
||||
try:
|
||||
data = jwt.decode(reset_token, LoginService.JWT_SECRET_KEY, algorithms=["HS256"])
|
||||
except:
|
||||
return jsonify({'status': 'INVALID', 'message': 'Link is invalid'}), 403
|
||||
|
||||
return jsonify({'status': 'INVALID2', 'message': 'Link is invalid'}), 403
|
||||
logger.error("GOT HERE 000002 ")
|
||||
if not data:
|
||||
invalid_data = {
|
||||
"error_message": "The link is invalid please try again later",
|
||||
@@ -92,10 +92,13 @@ class LoginService(BaseService):
|
||||
}
|
||||
return ResponseHelper.success(data=invalid_data)
|
||||
|
||||
user_data = data["user"]
|
||||
|
||||
logger.error(f"GOT HERE 000003 {user_data}")
|
||||
response_data = {
|
||||
"error_message": "",
|
||||
"pending_uid": data["pending_uid"],
|
||||
"pending_id": data["pending_id"],
|
||||
"pending_uid": user_data["pending_uid"],
|
||||
"pending_id": user_data["pending_id"],
|
||||
"reset_message": "Check your email to continue password reset.",
|
||||
"message_key": "continue_reset",
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ class RegisterService(BaseService):
|
||||
|
||||
SEND_EMAIL_FROM = Config.SEND_EMAIL_FROM
|
||||
SEND_EMAIL_PASS = Config.SEND_EMAIL_PASS
|
||||
THIS_SITE_URL = Config.THIS_SITE_URL
|
||||
|
||||
@staticmethod
|
||||
def encrypt_password(self, password):
|
||||
@@ -205,7 +206,7 @@ def send_register_mail(signup_email, pending_uid,pending_id,firstname, lastname)
|
||||
{"user": pending_member, 'exp' : datetime.datetime.utcnow() + datetime.timedelta(minutes=3330)},
|
||||
RegisterService.JWT_SECRET_KEY, algorithm='HS256'
|
||||
)
|
||||
panel_url = "https://qa-panel.mermsemr.com"
|
||||
panel_url = panel_url = RegisterService.THIS_SITE_URL # "https://qa-panel.mermsemr.com"
|
||||
link_url= str(panel_url) + '/csignup/' + jwt_part
|
||||
|
||||
msg_body = f"""
|
||||
|
||||
Reference in New Issue
Block a user