+
+ def check_password_expiry(self, outdata):
+ """
+ This method will check for password expiry of the user
+ :param outdata: user token information
+ """
+ user_list = None
+ present_time = time()
+ user = outdata["username"]
+ if self.config["authentication"].get("user_management"):
+ user_list = self.db.get_list("users", {"username": user})
+ if user_list:
+ user_content = user_list[0]
+ if not user_content.get("username") == "admin":
+ user_content["_admin"]["modified"] = present_time
+ if user_content.get("_admin").get("password_expire_time"):
+ password_expire_time = user_content["_admin"][
+ "password_expire_time"
+ ]
+ else:
+ password_expire_time = present_time
+ uid = user_content["_id"]
+ self.db.set_one("users", {"_id": uid}, user_content)
+ if not present_time < password_expire_time:
+ return True
+ else:
+ pass