added pass reset tokan
This commit is contained in:
@@ -75,22 +75,29 @@ class LoginService(BaseService):
|
|||||||
|
|
||||||
validated_data = LoginService.validate_data(data, ResetPassVerify())
|
validated_data = LoginService.validate_data(data, ResetPassVerify())
|
||||||
reset_token = validated_data.get('reset_token')
|
reset_token = validated_data.get('reset_token')
|
||||||
member = Members.get_member_by_username(username)
|
|
||||||
if not member:
|
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
|
||||||
|
|
||||||
|
if not data:
|
||||||
invalid_data = {
|
invalid_data = {
|
||||||
"error_message": "You will get email to continue the process if the account is valid",
|
"error_message": "The link is invalid please try again later",
|
||||||
"reset_message": "",
|
"reset_message": "",
|
||||||
"message_key": "invalid_username_or_password",
|
"message_key": "invalid_pass_reset_link",
|
||||||
}
|
}
|
||||||
return ResponseHelper.success(data=invalid_data)
|
return ResponseHelper.success(data=invalid_data)
|
||||||
reset_data = PasswordReset.create_reset(username=username)
|
|
||||||
BaseService.send_resetpass_mail(member.email, str(member.uid), member.id, "FF",
|
|
||||||
"LL") # pending_uid, pending_id, firstname, lastname
|
|
||||||
|
|
||||||
response_data = {
|
response_data = {
|
||||||
"error_message": "",
|
"error_message": "",
|
||||||
|
"pending_uid": data["pending_uid"],
|
||||||
|
"pending_id": data["pending_id"],
|
||||||
"reset_message": "Check your email to continue password reset.",
|
"reset_message": "Check your email to continue password reset.",
|
||||||
"message_key": "check_your_email_message",
|
"message_key": "continue_reset",
|
||||||
}
|
}
|
||||||
|
|
||||||
return ResponseHelper.success(data=response_data)
|
return ResponseHelper.success(data=response_data)
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ class WebContentsService(BaseService):
|
|||||||
"site_logo_text": "MY-GOOD-LOGO",
|
"site_logo_text": "MY-GOOD-LOGO",
|
||||||
"site_contact_email": "email@specialemail.com",
|
"site_contact_email": "email@specialemail.com",
|
||||||
"site_contact_phone": "911 111 1111",
|
"site_contact_phone": "911 111 1111",
|
||||||
|
"site_keywords": "Responsive, HTML5, DSAThemes, Landing, Software, Mobile App, SaaS, Startup, Creative, Digital Product",
|
||||||
"facebook": "myface.facebook.com",
|
"facebook": "myface.facebook.com",
|
||||||
"twitter": "mytwit.twitter.com",
|
"twitter": "mytwit.twitter.com",
|
||||||
"youtube": "myyou.youtube.com",
|
"youtube": "myyou.youtube.com",
|
||||||
|
|||||||
Reference in New Issue
Block a user