def get(self): """ Returns user's publicity. """ current_user_username = get_jwt_identity() user_status = DbHandler.get_user_publicity( DbHandler.get_user_id(current_user_username)) return make_response(jsonify(publicity=user_status), 200)
def get_n_digit_auth_code(username: str) -> str: """ Step 1: Start process of resetting password. Return hash format of user's ID + random generated N digit code.""" id = DbHandler.get_user_id(username) if id == -1: return "USER_NOT_FOUND" random_code = ResetPasswordCore.__generate_n_digit_code() forget_password_rendered_page = ResetPasswordCore.\ __render_forget_password_page(random_code) ResetPasswordCore.__send_email_to_user( username, 'Restfulness Forget Password Code', forget_password_rendered_page) return (ResetPasswordCore.__generate_hash_string(id, random_code))